Stop using deprecated SpecialPage constructor parameters - #82
Merged
Conversation
MediaWiki 1.46 deprecated the $restriction, $listed, $function, $file and $includable parameters of the SpecialPage constructor. SpecialBatchUpload passed three of them, so MediaWiki emitted a deprecation warning every time the special page was constructed. Pass only the page name to the parent constructor, and declare the required "upload" right by overriding getRestriction() instead. The $name and $restriction parameters of our own constructor were already ignored, and $listed was only ever the default, so no caller loses anything. getRestriction() is untyped in MediaWiki 1.43 to 1.45 and declared as ": string" in 1.46, so the override carries the return type to stay compatible across the whole supported range. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
malberts
force-pushed
the
fix/specialpage-constructor-deprecation
branch
from
August 5, 2026 09:59
b27c69d to
144fd53
Compare
MediaWiki 1.46 has been released, so failures against it are real failures rather than early warnings about an unreleased branch. Only the job tracking MediaWiki master stays non-blocking. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
malberts
force-pushed
the
fix/specialpage-constructor-deprecation
branch
from
August 5, 2026 10:06
144fd53 to
051d1d7
Compare
malberts
marked this pull request as ready for review
August 5, 2026 10:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #81
MediaWiki 1.46 deprecated the
$restriction,$listed,$function,$fileand$includableparameters of theSpecialPageconstructor.SpecialBatchUploadpassed three of them, so MediaWiki emitted a deprecation warningevery time the special page was constructed.
Only the page name is passed to the parent constructor now, and the required
uploadright is declared byoverriding
getRestriction(). Our own constructor already ignored its$nameand$restrictionarguments, and$listedwas only ever the default, so no caller loses anything.getRestriction()is untyped in MediaWiki 1.43 to 1.45 and declared as: stringin 1.46, so the override carriesthe return type to stay compatible across the whole supported range.
Also bumps the version to 3.0.3 and records the fix in the release notes. The MediaWiki 1.46 CI job is no
longer marked experimental now that 1.46 is released, so failures against it block. Only the job tracking
MediaWiki master stays non-blocking.
Verified against a local MediaWiki 1.46 install: the new test reproduces the reported warning before the fix and
passes after it,
Special:BatchUploadrenders without the warning (checked with Playwright), and the page stillrefuses access to users without the
uploadright.