From b1cc0225a9a079c30ab9d1abe03a548112de0465 Mon Sep 17 00:00:00 2001 From: Isabelle Hurbain-Palatin Date: Thu, 12 Sep 2024 11:45:41 +0200 Subject: [PATCH] Set language on ScribuntoContentHandler new ParserOutput I have reproduced at least one instance of the message "ParserOutput does not specify a language and no page language set in helper." by trying to query a rest.php html endpoint on a module with the scribunto-doc-page-does-not-exist message deactivated (which is the case on wikidata). I do not know if that path is the one that triggers the current large amount of these messages coming from Wikidata, but it looks reasonable to fix that one at least. I'm also not sure this fix is the right one - I'll let people with more Scribunto and ContentHandler experience chime on that :) Bug: T362312 Change-Id: I26c1683c803f5cafd08de83e8b428031414d1c4e --- includes/ScribuntoContentHandler.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/ScribuntoContentHandler.php b/includes/ScribuntoContentHandler.php index 35112f8e..5998b5f4 100644 --- a/includes/ScribuntoContentHandler.php +++ b/includes/ScribuntoContentHandler.php @@ -158,6 +158,7 @@ class ScribuntoContentHandler extends CodeContentHandler { $html .= $parserOutput->getRawText(); } else { $parserOutput = new ParserOutput(); + $parserOutput->setLanguage( $parserOptions->getTargetLanguage() ?? $docTitle->getPageLanguage() ); } if ( $docTitle ) {