Page MenuHomePhabricator

Invariant failed: Expecting : in parser function definiton
Open, LowPublic

Description

URL: /w/rest.php/commons.wikimedia.org/v3/page/pagebundle/Template%3ADecadeby/587250990
Trace:

from /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/assert/src/Assert.php(224)
#0 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Wt2Html/TT/TemplateHandler.php(334): Wikimedia\Assert\Assert::invariant(boolean, string)
#1 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Wt2Html/TT/TemplateHandler.php(1436): Wikimedia\Parsoid\Wt2Html\TT\TemplateHandler->resolveTemplateTarget(array, array, Wikimedia\Parsoid\Tokens\SourceRange)
#2 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Wt2Html/TT/TemplateHandler.php(1586): Wikimedia\Parsoid\Wt2Html\TT\TemplateHandler->onTemplate(Wikimedia\Parsoid\Tokens\SelfclosingTagTk)
#3 /srv/mediawiki/php-1.37.0-wmf.23/vendor/wikimedia/parsoid/src/Wt2Html/TT/TokenHandler.php(187): Wikimedia\Parsoid\Wt2Html\TT\TemplateHandler->onTag(Wikimedia\Parsoid\Tokens\SelfclosingTagTk)
...

Event Timeline

Arlolra moved this task from Needs Triage to Bugs & Crashers on the Parsoid board.
Arlolra added a subscriber: Arlolra.

Continues on from the line of patches for T188670

The culprit is,

-->[<noinclude>&lrm;</noinclude>[Category:<!--
-->{{#if<includeonly>exist</includeonly>:Category:<!--
-->{{{4<noinclude>|subject</noinclude>}}} by {{{5<noinclude>|criterion</noinclude>}}} by decade
| {{{4<noinclude>|subject</noinclude>}}} by {{{5<noinclude>|criterion</noinclude>}}} by decade
| {{#if<includeonly>exist</includeonly>:Category:<!--
  -->{{{4<noinclude>|subject</noinclude>}}} by decade by {{{5<noinclude>|criterion</noinclude>}}}
  | {{{4<noinclude>|subject</noinclude>}}} by decade by {{{5<noinclude>|criterion</noinclude>}}}
  | {{{4<noinclude>|subject</noinclude>}}} by {{{5<noinclude>|criterion</noinclude>}}} by decade
  }}
}}<!--
-->|={{#expr:trunc({{{1<noinclude>|{{CURRENTYEAR}}</noinclude>}}}{{{2|}}}/10+9000)}}<!--
-->]]<!--

The FIXME added in https://github.com/wikimedia/parsoid/commit/44b8ab39a2efe3ab7d40abe932a04186fd7b8262 explains what needs to be done,

FIXME: We need to account for the call to $this->stripIncludeTokens above and the safesubst replace.

Sigh .. ya, this whole mess is gnarly without Parsoid getting a separate preprocessor of its own ... or we need to jam more functionality into the TSP to deal will the {{#if<includeonly>exist</includeonly>:...}} and other such usages ... or we need to continue jamming the TemplateHandler's resolveTarget with stuff.