Repository navigation
Require MediaWiki 1.43 and replace APIs removed or deprecated after it - #196
Merged
Merged
Conversation
Composer now refuses to install package versions with known security advisories. MediaWiki 1.39 to 1.42 pin dependencies that have one, such as PHPUnit 9.6.16 and Guzzle, so these jobs fail while installing MediaWiki, before any test runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Composer refuses to install mediawiki-codesniffer 40 because the PHP_CodeSniffer version it pins has a security advisory, so the code style and static analysis CI jobs failed during composer install. Version 52 requires PHP_CodeSniffer 3.13.6, which has the fix. Apply the new rules with phpcbf: static arrow functions, explicit nullable types and whitespace. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Raise the minimum MediaWiki and Wikibase version to 1.43, the oldest version CI still tests. Stop declaring a PHP version in composer.json: MediaWiki enforces its own minimum. The README's requirements no longer name the releases for older MediaWiki versions, a list that would keep growing; the release notes record when support was dropped. Remove what only older versions needed: the string return of the special pages' getDescription() for MediaWiki before 1.41, its PHPStan baseline entries, Psalm baseline entries left over from a MediaWiki 1.39 check, and the skip of three edge-to-edge API tests on PHP 8.1 and later, which skipped them on every PHP version MediaWiki 1.43 supports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes #190 MediaWiki 1.47 removed the global aliases of Title, Html and EditPage, so on 1.47 every page view failed in the BeforePageDisplay hook. Import the namespaced classes, which all exist in MediaWiki 1.43, for every class that has one there: Title, TitleParser, MalformedTitleException, Content, JsonContent, Html, Message, SpecialPage, EditPage, OutputPage and IContextSource. Skin, Article, WikiPage and SpecialPageTestBase keep their global names: MediaWiki 1.43 has no namespaced version of them, and their aliases still exist in 1.47. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MediaWiki 1.47 removed the EditFilter hook, so invalid configuration on MediaWiki:WikibaseExport got saved. Validate it in the EditFilterMergedContent hook instead, which MediaWiki 1.43 also has. The hook refuses the edit with one message that includes the error table, so API clients now get the errors too, instead of "hookaborted". The message needs a parameter for the table, which the translations of wikibase-export-config-invalid lack, so it gets a new key, wikibase-export-config-invalid-errors. Since MediaWiki 1.45, getRevisionByTitle() emits a deprecation warning when given a LinkTarget. Look the config page up with PageLookup and pass the resulting page to it; a PageReference that is not a page identity fails on MediaWiki 1.43. Since MediaWiki 1.47, deletePage() in tests fails for a page that does not exist. Stop deleting the config page after each ConfigPageSmokeTest test: MediaWiki resets the tables between tests since 1.42. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wikibase 1.47 removed WikibaseRepo::getEntitySearchHelper(), so the subject search of Special:WikibaseExport failed on MediaWiki 1.47. Use WbSearch::getItemSearchHelper(), added in Wikibase 1.46, when it exists, and getEntitySearchHelper() before that. PHPStan and Psalm run against MediaWiki 1.43, whose Wikibase has no WbSearch, so their errors on that branch are baselined. Also drop setup that the no-matches search test does not need. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alistair3149
force-pushed
the
fix/require-mediawiki-1.43
branch
from
November 12, 2026 17:23
4226a95 to
fb47b44
Compare
alistair3149
marked this pull request as ready for review
November 12, 2026 17:27
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 #190
Wikibase Export now requires MediaWiki 1.43 and PHP 8.1, drops code that only older MediaWiki versions needed, and
replaces MediaWiki and Wikibase APIs that 1.44 to 1.47 removed or deprecated. On MediaWiki 1.47 this stops every page
view failing on the removed
Titlealias, makes the subject search of Special:WikibaseExport work again, andrestores the check that refuses invalid configuration on
MediaWiki:WikibaseExport, which stopped running when 1.47removed the
EditFilterhook. Builds on #195: merge it after #195, then retarget it to master.Human input
Goal and shape: goal set by @alistair3149; Claude chose the changes within it.
to drop deprecated methods and classes", following "the WikibaseExport CI was already broken, not from this PR,
we should fix it".
Claude offered.
Skin,ArticleandSpecialPageTestBasekeep their global names, pickedover keeping it open until they can be namespaced.
WbSearch.requirements since it will just keep growing for info that is no long relevant".
composer.jsonno longer declares a PHP version: "can be dropped too, MW already enforces it".Outcome: not reviewed by a human yet. Left for you: a skim of the diff.
Claude's calls
Skin,ArticleandSpecialPageTestBasekeep their globalnames: their namespaced classes arrive in 1.44 and 1.46, and their aliases, deprecated, still exist in 1.47.
EditFilterMergedContent, which sees the whole page after section merging. Itrefuses with one message that includes the error table, under the new key
wikibase-export-config-invalid-errors: the table needs a parameter that the 21 translations ofwikibase-export-config-invalidlack. The old key is no longer used and is gone fromen.jsonandqqq.json.The edit form shows one error box, as before, and API clients now get the error code
wikibase-export-config-invalid-errorswith the errors in itsinfo, instead ofhookaborted.action=mcrundo, whereEditFilternever ran. Core passesa context titled with the page and a
Userthere on 1.43 and 1.47, so the handler's types match; no test coversthese two paths.
WbSearch::getItemSearchHelper()when that method exists, andWikibaseRepo::getEntitySearchHelper()otherwise. The check ismethod_exists(), notclass_exists(): Wikibase1.44 and 1.45 have a
WbSearchclass without that method. PHPStan and Psalm, which run against 1.43, getbaseline entries for it.
PageLookupbeforegetRevisionByTitle(): 1.43 fails on a plainPageReferencethere, and passing aLinkTargetis deprecated since 1.45.PageStorechecks the link cachebefore it queries the page table.
which skipped them on every PHP version MediaWiki 1.43 supports.
ConfigPageSmokeTestno longer deletes the config page after each test: 1.47'sdeletePage()fails for a pagethat does not exist, and MediaWiki resets the tables between tests since 1.42.
merges.
$skinparameter of theBeforePageDisplayhandler to avoid theSkinalias: it wouldmake the handler's signature differ from the hook's.
versions other than 8.3.
The change
extension.json: requires MediaWiki 1.43; registersEditFilterMergedContentinstead ofEditFilter.composer.json: no PHP version constraint; MediaWiki enforces its own.README.md: PHP 8.1, MediaWiki and Wikibase 1.43, without pointers to the releases for older MediaWiki versions.i18n/en.json,i18n/qqq.json:wikibase-export-config-invalid-errorsreplaceswikibase-export-config-invalid.src/: namespaced imports;getDescription()of both special pages returns aMessagewithout the 1.41 versioncheck;
MediaWikiHooks::onEditFilterMergedContent();PageContentFetchertakes aPageLookup;WikibaseExportExtensionpicks the item search helper.WbSearchcheck added.ConfigPageEditValidationTest; the PHP 8.1 skip, the teardown deletion and one unneeded setup callremoved.
#194 changes the
SpecialWikibaseExportconstructor and merges with this branch except inphpstan-baseline.neon:keep #194's "If condition is always false" entry and this branch's two
WbSearchentries, and drop the "Ifcondition is always true" ones.
Verification evidence
Run locally on SQLite and PHP 8.3, with Wikibase from the matching REL branch. On 1.47, "strict" adds
convertDeprecationsToExceptions, so deprecation warnings fail tests.TypeErrors and 3 follow-on teardownerrors from the removed
Titlealias, andSpecialWikibaseExportTeston the constructor (Fix Special:WikibaseExport constructor on MediaWiki 1.46 and later #194).SpecialWikibaseExportTeston the constructor.With Fix Special:WikibaseExport constructor on MediaWiki 1.46 and later #194's changes applied on top: 123 tests OK, both plain and strict.
getRevisionByTitle()deprecation in 7 tests, thedeletePage()failure inConfigPageSmokeTest::testEditSmoke, andSearchEntitiesApiTest's two tests failing ongetEntitySearchHelper(); all pass now.ConfigPageEditValidationTest: before the hook change,testRefusesInvalidConfigandtestRefusalNamesTheInvalidSettingfail on 1.47 because the edit is saved, and on 1.43 onhookaborted. Againstthe two-message refusal, they fail on 1.47 with "(multiple errors)" and with an error text lacking
defaultStartYear. With the namespace check removed fromisConfigTitle(),testSavesOtherPagesWithoutValidatingThemfails.defaultStartYear, submitted as Admin over HTTP, on 1.43 and 1.47: the page is not created,and one error box shows the intro and the error table.
action=editwith the same config, default error format, on 1.43 and 1.47: codewikibase-export-config-invalid-errors, info "Your changes were not saved. They contain the following error:/defaultStartYear The data (string) must match the type: integer, null".
wbeditentity,search-entities?search=Acme&language=enreturns it with HTTP 200.search-entities endpoint return 200 or 302 (500 before), with no deprecation warnings in the output;
Special:WikibaseExport and Special:SpecialPages return 500 on the constructor (Fix Special:WikibaseExport constructor on MediaWiki 1.46 and later #194).
OK), static analysis, code style and linting all pass.