Skip to content

Stop using deprecated SpecialPage constructor parameters - #82

Merged
malberts merged 3 commits into
masterfrom
fix/specialpage-constructor-deprecation
Aug 5, 2026
Merged

Stop using deprecated SpecialPage constructor parameters#82
malberts merged 3 commits into
masterfrom
fix/specialpage-constructor-deprecation

Conversation

@malberts

@malberts malberts commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Fixes #81

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.

Only the page name is passed to the parent constructor now, and the required upload right is declared by
overriding getRestriction(). Our own constructor already ignored its $name and $restriction arguments, 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.

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:BatchUpload renders without the warning (checked with Playwright), and the page still
refuses access to users without the upload right.

AI-authored — Claude Code, Opus 5 (1M context); one-line ask from @malberts (the issue URL), plus a follow-up asking for the version bump; diff not yet human-reviewed; regression test seen failing then passing on a local MediaWiki 1.46 + PHP 8.3 install, before/after also checked in the browser.

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
malberts force-pushed the fix/specialpage-constructor-deprecation branch from b27c69d to 144fd53 Compare August 5, 2026 09:59
malberts and others added 2 commits August 5, 2026 12:05
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
malberts force-pushed the fix/specialpage-constructor-deprecation branch from 144fd53 to 051d1d7 Compare August 5, 2026 10:06
@malberts
malberts marked this pull request as ready for review August 5, 2026 10:22
@malberts
malberts merged commit 9ee5199 into master Aug 5, 2026
14 checks passed
@malberts
malberts deleted the fix/specialpage-constructor-deprecation branch August 5, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecation warning at SpecialPage constructor

1 participant