Repository navigation
Pass only the page name to the SpecialPage constructor of the Designer - #123
Open
alistair3149 wants to merge 3 commits into
Open
alistair3149 wants to merge 3 commits into
alistair3149 wants to merge 3 commits into
Conversation
MediaWiki 1.47 removed the SpecialPage constructor parameters after the name and throws a BadMethodCallException when any is passed; 1.46 still accepts them but reports a deprecation. The Designer passed an empty restriction and $listed = true, both the defaults, so it now passes only its name. It stays unrestricted and listed on Special:SpecialPages. On 1.47 the exception broke Special:KnowledgeGraphDesigner and also Special:SpecialPages, which constructs every registered special page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #123 +/- ##
============================================
- Coverage 80.68% 80.67% -0.02%
Complexity 186 186
============================================
Files 18 18
Lines 1807 1806 -1
Branches 216 216
============================================
- Hits 1458 1457 -1
Misses 197 197
Partials 152 152 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The title was compared with the page's own description, which comes from the same page name, so a constructor that lost the name still passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alistair3149
marked this pull request as ready for review
November 12, 2026 16:20
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.
On MediaWiki 1.47,
SpecialPage::__construct()throws aBadMethodCallExceptionwhen it gets more than the page name; 1.46 accepts the extra arguments but reports a deprecation.SpecialKnowledgeGraphDesignerpassed an empty restriction and$listed = true, so on 1.47 Special:KnowledgeGraphDesigner and Special:SpecialPages, which constructs every special page, failed with a 500 for every user. The Designer now passes only its name; both arguments were the defaults, so it stays unrestricted and listed.Human input
Goal and shape: goal set by @alistair3149: "Do an audit to check all of our extension repo to see if StarCitizenTools/mediawiki-extensions-Thumbro#112 applies to us", then "So we only need to patch PageApprovals, WikibaseExport, SemanticCite, SemanticWatchlist, and KnowledgeGraph". The audit and the change are Claude's.
Outcome: not reviewed by a human yet. Left for you: the two-line production diff and whether the 1.47 follow-up below gets its own issue.
Claude's calls
SpecialAdmin, which passes its restriction to the constructor only below MediaWiki 1.46, since this page has no restriction to keep; the new test loads the page through the special page factory by its registered name, as a request does;testExecuteSetsHeadersAndOutputnow expects the title from theknowledgegraphdesignermessage rather than from the page's own description, so a constructor that lost the name fails it; the changelog entry sits in its own commit so it can link the fix commit like the existing Unreleased entry, which a squash or rebase merge would orphan.maintoo, because 1.46 only reports a deprecation; it fails only on 1.47, which was run locally.Not in this PR
On 1.47, Special:KnowledgeGraphDesigner still fails once MediaWiki:KnowledgeGraphOptions exists, which the extension creates on the first page view:
KnowledgeGraph::getWikipageContent()callsContent::getNativeData(), which 1.47 removed. The parser function'sgraph-optionsandproperty-optionsgo through the same method, so this needs its own fix.Verification evidence
$wgCachePrefix = falsethere):testDesignerIsListedOnSpecialPageserrors onmainwith theBadMethodCallExceptionfromSpecialPageFactory::getPage()(checked with thesetUp()construction disabled, so the error came from the test body) and passes with the fix.SpecialKnowledgeGraphDesignerTest(8 existing tests plus the new one): 9 errors onmain, OK (9 tests) with the fix while MediaWiki:KnowledgeGraphOptions does not exist.main, Special:KnowledgeGraphDesigner and Special:SpecialPages return 500 with theBadMethodCallException. With the fix, the Designer returns 200, then 500 on the next load (getNativeData()), and Special:SpecialPages returns 200 and links the Designer.main149 tests, 16 errors, 16 failures; fix 150 tests, 8 errors, 16 failures. The difference is exactly the 8 existingSpecialKnowledgeGraphDesignerTesterrors; the rest fail onmaintoo (getNativeData()and SMW-backed fixtures).composer analyze,composer phanandcomposer minus-xpass. Passing$listed = falsemakes the new test fail.parent::__construct()given no name,testExecuteSetsHeadersAndOutputfails ("Failed asserting that two strings are identical").main(run).