Reduced Test Case:
{|{{Infobox aircraft begin }}{{Infobox aircraft type|number built=unknown, 300 ordered<ref>{{cite web|title=The Cannon Pioneers}}</ref>}} |}
The following commandline on scandium causes the crasher. The "--pageName" argument is necessary.
php bin/parse.php --pageName 'SPAD_S.XII' < /tmp/wt
See the comments in the body of this phab task for analysis. This bug is present in the JS code as well, just that these assertions aren't present there to be triggered. The pagename argument is what ensures that the expansion of the first template adds the [[Category:No local image but image on Wikidata]] wikitext at the bottom. The presence of fostered content exposes the bug by ensuring that the data-mw on the table representing the expanded attribute isn't replaced with information about the template wrapping. With fostered content, the fostered content gets the overall template wrapper and the table retains its bogus data-mw.
Request URLs:
- /w/rest.php/en.wikipedia.org/v3/page/pagebundle/User%3ARlandmann%2FB-17_Flying_Fortress/887607268
- /w/rest.php/en.wikipedia.org/v3/page/pagebundle/SPAD_S.XII/933888325
- /w/rest.php/sl.wikipedia.org/v3/transform/wikitext/to/pagebundle/RMS_Olympic
Exception Trace:
#0 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMDataUtils.php(69): Wikimedia\Assert\Assert::invariant(boolean, string) #1 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMDataUtils.php(91): Wikimedia\Parsoid\Utils\DOMDataUtils::getNodeData(DOMElement) #2 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Wt2Html/PP/Handlers/CleanUp.php(164): Wikimedia\Parsoid\Utils\DOMDataUtils::getDataParsoid(DOMElement) #3 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Wt2Html/DOMPostProcessor.php(471): Wikimedia\Parsoid\Wt2Html\PP\Handlers\CleanUp::cleanupAndSaveDataParsoid(array, DOMElement, Wikimedia\Parsoid\Config\Env, boolean, stdClass) #4 [internal function]: Wikimedia\Parsoid\Wt2Html\DOMPostProcessor->Wikimedia\Parsoid\Wt2Html\{closure}(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #5 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(77): call_user_func(Closure, DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #6 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(146): Wikimedia\Parsoid\Utils\DOMTraverser->callHandlers(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #7 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(158): Wikimedia\Parsoid\Utils\DOMTraverser->traverse(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #8 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(158): Wikimedia\Parsoid\Utils\DOMTraverser->traverse(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #9 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(158): Wikimedia\Parsoid\Utils\DOMTraverser->traverse(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #10 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(158): Wikimedia\Parsoid\Utils\DOMTraverser->traverse(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #11 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(158): Wikimedia\Parsoid\Utils\DOMTraverser->traverse(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #12 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(158): Wikimedia\Parsoid\Utils\DOMTraverser->traverse(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #13 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(158): Wikimedia\Parsoid\Utils\DOMTraverser->traverse(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #14 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(158): Wikimedia\Parsoid\Utils\DOMTraverser->traverse(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #15 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(158): Wikimedia\Parsoid\Utils\DOMTraverser->traverse(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #16 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(158): Wikimedia\Parsoid\Utils\DOMTraverser->traverse(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #17 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(158): Wikimedia\Parsoid\Utils\DOMTraverser->traverse(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #18 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(158): Wikimedia\Parsoid\Utils\DOMTraverser->traverse(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #19 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(158): Wikimedia\Parsoid\Utils\DOMTraverser->traverse(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, stdClass) #20 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Utils/DOMTraverser.php(158): Wikimedia\Parsoid\Utils\DOMTraverser->traverse(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, NULL) #21 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Wt2Html/DOMPostProcessor.php(145): Wikimedia\Parsoid\Utils\DOMTraverser->traverse(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean, NULL) #22 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Wt2Html/DOMPostProcessor.php(829): Wikimedia\Parsoid\Wt2Html\DOMPostProcessor->Wikimedia\Parsoid\Wt2Html\{closure}(DOMElement, Wikimedia\Parsoid\Config\Env, array, boolean) #23 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Wt2Html/DOMPostProcessor.php(886): Wikimedia\Parsoid\Wt2Html\DOMPostProcessor->doPostProcess(DOMDocument) #24 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Wt2Html/DOMPostProcessor.php(903): Wikimedia\Parsoid\Wt2Html\DOMPostProcessor->process(DOMDocument) #25 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Wt2Html/ParserPipeline.php(148): Wikimedia\Parsoid\Wt2Html\DOMPostProcessor->processChunkily(string, array) #26 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Wt2Html/ParserPipeline.php(198): Wikimedia\Parsoid\Wt2Html\ParserPipeline->parseChunkily(string, array) #27 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Wt2Html/ParserPipelineFactory.php(290): Wikimedia\Parsoid\Wt2Html\ParserPipeline->parseToplevelDoc(string, array) #28 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Core/WikitextContentModelHandler.php(78): Wikimedia\Parsoid\Wt2Html\ParserPipelineFactory->parse(string) #29 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Parsoid.php(148): Wikimedia\Parsoid\Core\WikitextContentModelHandler->toDOM(Wikimedia\Parsoid\Config\Env) #30 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/src/Parsoid.php(180): Wikimedia\Parsoid\Parsoid->parseWikitext(MWParsoid\Config\PageConfig, array) #31 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/extension/src/Rest/Handler/ParsoidHandler.php(529): Wikimedia\Parsoid\Parsoid->wikitext2html(MWParsoid\Config\PageConfig, array, NULL) #32 /srv/mediawiki/php-1.35.0-wmf.26/vendor/wikimedia/parsoid/extension/src/Rest/Handler/PageHandler.php(66): MWParsoid\Rest\Handler\ParsoidHandler->wt2html(MWParsoid\Config\PageConfig, array) #33 /srv/mediawiki/php-1.35.0-wmf.26/includes/Rest/Router.php(353): MWParsoid\Rest\Handler\PageHandler->execute() #34 /srv/mediawiki/php-1.35.0-wmf.26/includes/Rest/Router.php(308): MediaWiki\Rest\Router->executeHandler(MWParsoid\Rest\Handler\PageHandler) #35 /srv/mediawiki/php-1.35.0-wmf.26/includes/Rest/EntryPoint.php(138): MediaWiki\Rest\Router->execute(MediaWiki\Rest\RequestFromGlobals) #36 /srv/mediawiki/php-1.35.0-wmf.26/includes/Rest/EntryPoint.php(105): MediaWiki\Rest\EntryPoint->execute() #37 /srv/mediawiki/php-1.35.0-wmf.26/rest.php(31): MediaWiki\Rest\EntryPoint::main() #38 /srv/mediawiki/w/rest.php(3): require(string) #39 {main}