Source code & patches
MediaWiki and its ecosystem are great software, however they are not always fitted for a professional use (or for the specific approach envisaged by WikiSphere).
Here are a number of patches both to some core files of MediaWiki (mainly to support the upload of files under page and sub-pages), and to some key-extensions as well, typically with the aim to complete and refine their set of features.
All the patches concern the latest stable version of Mediawiki (1.36) and the corresponding version of the extensions, if you want to use one or more of them (some of them could be correlated, so it is recommended to install them as they are grouped below) just copy the entire file content following the related link, do a copy of the existing files on your wiki, and replace them !
Mediawiki
Installation
file | edits |
---|---|
maintenance/install.php | (added feature) added options "additionaldb" to allow creation of additional databases without replacing exiting LocalSettings.php |
includes/installer/CliInstaller.php | (added feature) implemented the option above |
Skins
file | edits |
---|---|
includes/skins/SkinTemplate.php | (added feature) adds class "mw-content_model-" + contentModel in order to correctly display plain text on html pages |
Files/Upload
file | edits |
---|---|
LocalSettings.php | $wgUseInstantCommons = false;
$wgIllegalFileChars = ":\\\\"; $wgHashedUploadDirectory = false; $wgWikisphereUploadDisableWarnings = true; $wgUploadPath = "{$wgScriptPath}/media"; $wgUploadDirectory = "{$IP}/media/" . $domain; |
includes/GlobalFunctions.php | support for path (page/subpage) in file names |
includes/filerepo/file/File.php | support for path (page/subpage) in file names |
includes/upload/UploadBase.php |
|
includes/upload/UploadFromStash.php | support for path (page/subpage) in file names |
includes/upload/UploadFromFile.php | support for path (page/subpage) in file names |
includes/api/ApiUpload.php | support for path (page/subpage) in file names |
img_auth.php | |
resources/src/mediawiki.util/util.js | support for images with path in MultimediaViewer |
resources/src/mediawiki.Upload.BookletLayout/BookletLayout.js | |
resources/src/mediawiki.ForeignStructuredUpload.BookletLayout/BookletLayout.js | |
resources/src/mediawiki.api/upload.js |
Page deleted
file | edits |
---|---|
includes/page/Article.php | (added feature) on article deletion, it adds a link towards the parent page if existing |
MsUpload
Uploaded files will be saved under the edited page, eg. My page/my_picture.jpg
file | edits |
---|---|
Source code & patches/extensions/MsUpload/resources/MsUpload.js |
|
PageForms
file | edits |
---|---|
extensions/PageForms/includes/PF_AutoeditAPI.php |
|
extensions/PageForms/includes/PF_FormPrinter.php |
|
extensions/PageForms/includes/forminputs/PF_TreeInput.php |
|
extensions/PageForms/includes/forminputs/PF_Tree.php | (see above) |
extensions/PageForms/includes/forminputs/WS_ComboBoxInput.php |
|
extensions/PageForms/libs/ext.pf.select2.base.js | (fixed, but to review for general use) the scripts added an empty item as the first option and that was not always the expected behavior |
extensions/PageForms/libs/ext.pf.select2.combobox.js |
|
extensions/PageForms/includes/parserfunctions/PF_FormLink.php | (added feature) parameter "class" in form link button template |
extensions/PageForms/includes/forminputs/PF_OpenLayersInput.php |
|
to-do
- PageForms does not handle correctly selects with mapped values, as described here, specifically, instead than allowing options of kind value => label (where the label is visible to the user, and the value the one handled by the form) it only allows options like label => label, and the issue appears both server and client side
SemanticMediaWiki
file | edits |
---|---|
extensions/SemanticMediaWiki/src/ParserData.php | See here https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/4907 The semantic properties were not always updated on page save |
extensions/SemanticMediaWiki/src/Query/ResultPrinters/ResultPrinter.php | in the function "getFurtherResultsLink", limit and offset will be reset if limit is less than 20 |
SemanticExtraSpecialProperties
Extension:Semantic_Extra_Special_Properties
file | edits |
---|---|
extensions/SemanticExtraSpecialProperties/data/definitions.json | commented the alias exif-artist, which causes a conflict with the property:Author, becoming non UserAnnotable |
Scribunto / PageExchange
The following edits are necessary to correctly import modules (page content model "Scribunto") through the extension Page_Exchange. (See for instance this package).
file | edits |
---|---|
extensions/Scribunto/includes/common/Hooks.php | (fixed) the function implementing the hook "oncontentHandlerDefaultModelFor" returned true instead than false (false stops the process to determine the page's content model) |
extensions/PageExchange/includes/PXCreatePageJob.php | (fixed) added ScribuntoContent for pages with namespace NS_MODULE |