Page MenuHomePhabricator

ParserOutput::addTemplate() interaction with ParserOptions::getTemplateCallback()
Open, Needs TriagePublic

Description

See T296023 re: Title-related types in this API.

But, further, this method interacts with user hooks. From Parsoid's perspective, Parsoid is given a string title in wikitext. This is then resolved this to an actual revision, maybe with a different title, using the ParserOptions::getTemplateCallback() (aka Parser::statelessFetchTemplate() in most cases) and then *that* thing is what you register with ParserOutput.

But I don't really want any of that to be visible to Parsoid. Once we've passed the string name of the template over to the MediaWiki side for "resolution", I'd prefer that all the details of Title/Revision/id etc *stay* on the MediaWiki side and so the MediaWiki side should be responsible for updating the Template dependencies not Parsoid. OTOH, we need *something* back because eventually Parsoid has to fetch the final resulting title and expand it.

Untangle this mess.

Related Objects

StatusSubtypeAssignedTask
OpenReleaseNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenFeatureNone
OpenNone
OpenNone
Resolvedssastry
Resolvedssastry
Resolvedcscott
Resolvedcscott
Resolvedcscott
ResolvedNone
Resolvedssastry
Resolvedcscott
Resolvedcscott
Resolvedcscott
Resolvedcscott
ResolvedPRODUCTION ERRORLucas_Werkmeister_WMDE
ResolvedPRODUCTION ERRORabi_
ResolvedPRODUCTION ERRORcscott
ResolvedPRODUCTION ERRORroman-stolar
ResolvedNone
ResolvedNone
Resolvedmatmarex
Resolvedmatmarex
Resolvedcscott
Resolvedcscott
Resolvedcscott
Resolvedihurbain
ResolvedNone
Resolvedcscott
ResolvedNone
Resolvedssastry
Declinedssastry
ResolvedPRODUCTION ERRORssastry
Resolvedcscott
Resolvedssastry
ResolvedMSantos
Resolvedihurbain
OpenNone
Resolvedcscott
DeclinedNone
DeclinedNone
DeclinedNone
DeclinedNone
Resolvedppelberg
ResolvedBUG REPORTNone
ResolvedPRODUCTION ERRORJdlrobson-WMF
ResolvedEsanders
OpenNone
StalledNone
OpenNone
OpenNone
OpenBUG REPORTNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolvedcscott
Resolvedcscott
OpenNone
Resolvedmatmarex
OpenNone
OpenNone
Resolvedcscott
ResolvedABreault-WMF
Resolvedcscott
Opencscott
Resolvedssastry
ResolvedJgiannelos
OpenJgiannelos
OpenJgiannelos
OpenJgiannelos
OpenJgiannelos
ResolvedJgiannelos
OpenNone

Event Timeline

Note that there's also an issue with Parsoid not having the page id, needed for the current ::addTemplate callback, and this should be resolved with a link batch (T357048). The issue of parsoid not having the revision id is what's addressed in the task description -- the correct revision ID to use is resolved by the hookable template callback mechanism, and at the moment that is not exposed to parsoid.