Pass language to File::getDimensionsString for MediaWiki 1.47 compatibility#48
Merged
Merged
Conversation
…bility Fixes #47 File::getDimensionsString() gained a required $lang parameter in MediaWiki 1.47 (optional since 1.46), so calling it without arguments threw an ArgumentCountError when rendering local media values. Passing the content language works across the whole supported range: it is harmlessly ignored on 1.45 and earlier, satisfies the optional parameter on 1.46, and the required one on 1.47+. The existing formatting tests format a non-existent file and never reach the metadata path. InlineImageFormatterTest stubs RepoGroup to return a file, exercising getDimensionsString so a regression is caught on versions where the parameter is required. CI: add REL1_44/45/46 to the matrix, and repair the install script so the matrix runs again: disable Composer 2.10's security-advisory blocking (older branches pin flagged dependency versions) and allow dev/beta stability for the master job's Wikibase dependencies. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Wikibase REL1_45 and later pull in a beta-stability dependency, so allow dev/beta stability for every branch (prefer-stable keeps everything else on stable). MediaWiki 1.46 dropped tests/phpunit/phpunit.php, so generate the PHPUnit config and run vendor/bin/phpunit there instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The GitHub tarball omits export-ignored files such as phpunit.xml.template, which MediaWiki 1.46 and later need to generate their PHPUnit config. Clone the repository instead, and bump the MediaWiki cache key so stale tarball caches are rebuilt. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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 #47
File::getDimensionsString()gained a required$langparameter in MediaWiki 1.47 (optional since 1.46), so calling it without arguments threw anArgumentCountErrorwhen rendering local media values. Passing the content language works across the whole supported range: it is harmlessly ignored on 1.45 and earlier, satisfies the optional parameter on 1.46, and the required one on 1.47+.The existing formatting tests format a non-existent file and never reach the metadata path.
InlineImageFormatterTeststubsRepoGroupto return a file, exercisinggetDimensionsStringso a regression is caught on versions where the parameter is required.CI: add REL1_44/45/46 to the matrix, and repair it so it runs again across the whole range:
phpunit.xml.templatethat 1.46+ needs, and use the generated PHPUnit config on 1.46+.The full matrix from 1.40 through master is green, so the fix is verified on MediaWiki master, where the parameter is required.
Written by Claude Code, Opus 4.8. Result of back-and-forth with @JeroenDeDauw, including his decision to take the comprehensive CI route. Context: the WikibaseLocalMedia codebase, MediaWiki core source from REL1_43 through master, the extension's GitHub Actions CI, and web research on the
getDimensionsStringsignature change and Composer 2.10's advisory blocking.🤖 Generated with Claude Code