Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.patch -text
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion clone_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions wikibase-local-media-parser-options.patch
Original file line number Diff line number Diff line change
@@ -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(),