Source code & patches: Difference between revisions
No edit summary |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 97: | Line 97: | ||
|[[Source code & patches/resources/src/mediawiki.ForeignStructuredUpload.BookletLayout/BookletLayout.js|resources/src/mediawiki.ForeignStructuredUpload.BookletLayout/BookletLayout.js]] | |[[Source code & patches/resources/src/mediawiki.ForeignStructuredUpload.BookletLayout/BookletLayout.js|resources/src/mediawiki.ForeignStructuredUpload.BookletLayout/BookletLayout.js]] | ||
|show checkbox "Upload under current page" in VisualEditor's file upload | |show checkbox "Upload under current page" in VisualEditor's file upload | ||
|- | |||
|[[Source code & patches/resources/Resources.php|resources/Resources.php]] | |||
|added label key "upload-form-label-own-work-custom" | |||
|- | |- | ||
|[[Source code & patches/resources/src/mediawiki.api/upload.js|resources/src/mediawiki.api/upload.js]] | |[[Source code & patches/resources/src/mediawiki.api/upload.js|resources/src/mediawiki.api/upload.js]] | ||
Line 138: | Line 141: | ||
!file | !file | ||
!edits | !edits | ||
|- | |||
|[[Source code & patches/extensions/PageForms/libs/PF simpleupload.js|extensions/PageForms/libs/PF_simpleupload.js]] | |||
|(added feature) support for uploading a picture under the current page | |||
|- | |- | ||
|[[/extensions/PageForms/includes/PF_AutoeditAPI.php|extensions/PageForms/includes/PF_AutoeditAPI.php]] | |[[/extensions/PageForms/includes/PF_AutoeditAPI.php|extensions/PageForms/includes/PF_AutoeditAPI.php]] | ||
Line 205: | Line 211: | ||
|[[Source code & patches/extensions/SemanticMediaWiki/src/Query/ResultPrinters/ResultPrinter.php|extensions/SemanticMediaWiki/src/Query/ResultPrinters/ResultPrinter.php]] | |[[Source code & patches/extensions/SemanticMediaWiki/src/Query/ResultPrinters/ResultPrinter.php|extensions/SemanticMediaWiki/src/Query/ResultPrinters/ResultPrinter.php]] | ||
|in the function "getFurtherResultsLink", limit and offset will be reset if limit is less than 20 | |in the function "getFurtherResultsLink", limit and offset will be reset if limit is less than 20 | ||
|- | |||
|[[Source code & patches/extensions/SemanticMediaWiki/src/Factbox/Factbox.php|extensions/SemanticMediaWiki/src/Factbox/Factbox.php]] | |||
|populate Factbox using semantic properties from the store instead than from the parser | |||
|} | |} | ||
<br /> | <br /> |
Latest revision as of 22:30, 2 January 2022
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[edit | edit source]
Installation[edit | edit source]
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[edit | edit source]
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[edit | edit source]
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 | display images with path |
resources/src/mediawiki.util/util.js | support for images with path in MultimediaViewer |
resources/src/mediawiki.Upload.BookletLayout/BookletLayout.js | allow uploading a file under the current page from VisualEditor |
resources/src/mediawiki.ForeignStructuredUpload.BookletLayout/BookletLayout.js | show checkbox "Upload under current page" in VisualEditor's file upload |
resources/Resources.php | added label key "upload-form-label-own-work-custom" |
resources/src/mediawiki.api/upload.js | allow uploading a file under the current page from VisualEditor |
Page deleted[edit | edit source]
file | edits |
---|---|
includes/page/Article.php | (added feature) on article deletion, it adds a link towards the parent page if existing |
MsUpload[edit | edit source]
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[edit | edit source]
file | edits |
---|---|
extensions/PageForms/libs/PF_simpleupload.js | (added feature) support for uploading a picture under the current page |
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[edit | edit source]
- 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[edit | edit source]
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 |
extensions/SemanticMediaWiki/src/Factbox/Factbox.php | populate Factbox using semantic properties from the store instead than from the parser |
SemanticExtraSpecialProperties[edit | edit source]
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[edit | edit source]
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 |