Skip to content

Pass language to File::getDimensionsString for MediaWiki 1.47 compatibility#48

Merged
JeroenDeDauw merged 3 commits into
masterfrom
fix-issue-47-getdimensionsstring-lang
Jun 11, 2026
Merged

Pass language to File::getDimensionsString for MediaWiki 1.47 compatibility#48
JeroenDeDauw merged 3 commits into
masterfrom
fix-issue-47-getdimensionsstring-lang

Conversation

@JeroenDeDauw

@JeroenDeDauw JeroenDeDauw commented Jun 11, 2026

Copy link
Copy Markdown
Member

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 it so it runs again across the whole range:

  • disable Composer 2.10's security-advisory blocking (older branches pin flagged dependency versions);
  • allow dev/beta stability (Wikibase REL1_45+ pulls in a beta dependency);
  • clone MediaWiki instead of downloading the tarball, which omits the export-ignored phpunit.xml.template that 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 getDimensionsString signature change and Composer 2.10's advisory blocking.

🤖 Generated with Claude Code

JeroenDeDauw and others added 3 commits June 12, 2026 01:07
…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>
@JeroenDeDauw JeroenDeDauw marked this pull request as ready for review June 11, 2026 23:29
@JeroenDeDauw JeroenDeDauw merged commit 832d4e7 into master Jun 11, 2026
20 checks passed
@JeroenDeDauw JeroenDeDauw deleted the fix-issue-47-getdimensionsstring-lang branch June 11, 2026 23:29
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.

Compatibility with wmf/1.47.0-wmf.5

1 participant