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
This commit is contained in:
Isabelle Hurbain-Palatin 2024-09-12 11:45:41 +02:00
parent a01cc2f2f8
commit b1cc0225a9

View file

@ -158,6 +158,7 @@ class ScribuntoContentHandler extends CodeContentHandler {
$html .= $parserOutput->getRawText();
} else {
$parserOutput = new ParserOutput();
$parserOutput->setLanguage( $parserOptions->getTargetLanguage() ?? $docTitle->getPageLanguage() );
}
if ( $docTitle ) {