MediaWiki升级到1.43后,扩展TreeAndMenu不工作了,而作者的更新停止在了4.2.5(2021-10-31)。
从讨论中可以看到已经有网友联系作者(但似乎没有回应)并提交了修改补丁,主要针对的是extension.json
文件。
其一是将jQuery.cookie
切换到mediawiki.cookie
,其二是对其中的配置方式进行了修订。
根据上述内容修改后的代码如下:
{
"name": "TreeAndMenu",
"version": "4.2.5, 2021-10-31",
"author": [
"[http://www.organicdesign.co.nz/aran Aran Dunkley]",
"[http://absorto.dev Igor Absorto]"
],
"url": "https://www.mediawiki.org/wiki/Extension:TreeAndMenu",
"descriptionmsg": "treeandmenu-desc",
"license-name": "[https://www.gnu.org/licenses/gpl-2.0.html GNU General Public Licence 2.0] or later",
"type": "parserhook",
"callback": "TreeAndMenu::onRegistration",
"config": {
"TreeAndMenuPersistIfId": {
"description": "Makes trees with id attributes have persistent state",
"public": true,
"value": false
},
"TreeAndMenuSidebarMenuPage": {
"description": "Specify menu page to be used as a sidebar menu",
"public": true,
"value": false
},
"TreeAndMenuSidebarMenuHeading": {
"description": "Specify the heading line for sidebar menu",
"public": true,
"value": false
}
},
"AutoloadClasses": {
"TreeAndMenu": "TreeAndMenu_body.php"
},
"ExtensionMessagesFiles": {
"TreeAndMenuMagic": "TreeAndMenu.i18n.magic.php"
},
"MessagesDirs": {
"TreeAndMenu": ["i18n"]
},
"Hooks": {
"SkinBuildSidebar": "TreeAndMenu::onSkinBuildSidebar"
},
"ResourceModules": {
"ext.treeandmenu": {
"styles": ["fancytree/fancytree.css", "suckerfish/suckerfish.css"],
"scripts": [
"fancytree/jquery.fancytree.js",
"fancytree/jquery.fancytree.persist.js",
"fancytree/jquery.fancytree.mediawiki.js",
"fancytree/fancytree.js",
"suckerfish/suckerfish.js"
],
"dependencies": [
"jquery.ui",
"mediawiki.cookie",
"jquery.client"
],
"targets": [
"desktop",
"mobile"
]
}
},
"ResourceFileModulePaths": {
"localBasePath": "",
"remoteExtPath": "TreeAndMenu"
},
"manifest_version": 2
}
更新完毕后,刷新页面,恢复正常。