diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ec1ffa8 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.patch -text diff --git a/Dockerfile b/Dockerfile index 8f288f4..ef483be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN apt-get update && \ WORKDIR / -COPY wikibase-submodules-from-github-instead-of-phabricator.patch clone_all.sh ./ +COPY wikibase-submodules-from-github-instead-of-phabricator.patch wikibase-local-media-parser-options.patch clone_all.sh ./ RUN bash clone_all.sh diff --git a/clone_all.sh b/clone_all.sh index 6744a48..6a96755 100755 --- a/clone_all.sh +++ b/clone_all.sh @@ -149,7 +149,9 @@ wait git clone --depth=1 https://github.com/wikimedia/mediawiki-extensions-Wikibase.git --single-branch -b ${WMF_BRANCH} mediawiki/extensions/Wikibase && \ patch -d mediawiki/extensions/Wikibase -Np1 <./wikibase-submodules-from-github-instead-of-phabricator.patch && \ git -C mediawiki/extensions/Wikibase submodule update --init --recursive - +# Temporary fix: WikibaseLocalMedia crashes on MW 1.47 (OutputPage::parserOptions() removed). +# Remove once upstream merges https://github.com/ProfessionalWiki/WikibaseLocalMedia/pull/46 +patch -d mediawiki/extensions/WikibaseLocalMedia -Np1 <./wikibase-local-media-parser-options.patch # Workaround for https://phabricator.wikimedia.org/T388624 cd mediawiki/extensions/DisplayTitle git fetch https://gerrit.wikimedia.org/r/mediawiki/extensions/DisplayTitle refs/changes/48/1126048/1 && git checkout -b change-1126048 FETCH_HEAD diff --git a/wikibase-local-media-parser-options.patch b/wikibase-local-media-parser-options.patch new file mode 100644 index 0000000..2fcd952 --- /dev/null +++ b/wikibase-local-media-parser-options.patch @@ -0,0 +1,19 @@ +--- a/src/Services/FormatterBuilder.php 2026-07-15 08:29:41.078360443 +0000 ++++ b/src/Services/FormatterBuilder.php 2026-07-15 09:56:24.441137709 +0000 +@@ -4,6 +4,7 @@ + + namespace Wikibase\LocalMedia\Services; + ++use ParserOptions; + use RequestContext; + use ValueFormatters\FormatterOptions; + use ValueFormatters\ValueFormatter; +@@ -27,7 +28,7 @@ + + if ( $snakFormat->isPossibleFormat( SnakFormatter::FORMAT_HTML_VERBOSE, $format ) ) { + return new InlineImageFormatter( +- RequestContext::getMain()->getOutput()->parserOptions(), ++ ParserOptions::newFromContext( RequestContext::getMain() ), + $this->thumbLimits, + $options->getOption( ValueFormatter::OPT_LANG ), + new LocalImageLinker(),