Page MenuHomePhabricator

Allow cross-slot access during HTML rendering.
Open, NormalPublic

Description

When generating a ParserOutput object for the content of one slot (via ContentHandler::getParserOutput), it should be possible to access the Content of other slots in the same revision, to allow cross-slot data access (e.g. transcluding information from some auxiliary slot into the output of the main slot). This should work for atomic edits too: when previewing an edit that changes slots X and Y, and the content of slot X uses parts of Y, the new content of Y should be visible in the rendering of X (as well as in the combined rendering of all slots).

An initial idea is to pass RevisionSlots (including inherited slots, after PST) to ContentHandler::getParserOutput. The relevant code is in WikiPage::prepareContentForEdit (resp. PageUpdater::prepareContentForEdit).

Note: This does not block SDC General, since SDC doesn't use atomic edits, and Wikibase doesn't rely on MediaWiki's transclusion mechanism. For cross-slot access as needed by SDC, see T194730: Ensure that Wikibase data access to MediaInfo on file description pages works with MCR .

Related Objects

StatusAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenNone
ResolvedAbit
OpenNone
OpenNone
OpenNone
OpenNone
DuplicateNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolvedppelberg
ResolvedKrinkle
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolveddaniel
Resolveddaniel
InvalidTgr
Resolveddaniel
ResolvedTgr
ResolvedTgr
ResolvedTgr
ResolvedBstorm
ResolvedCCicalese_WMF
OpenNone
OpenNone
Resolvedawight
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolvedovasileva
OpenNone
Resolveddaniel
ResolvedJdforrester-WMF
Resolveddaniel
ResolvedJdforrester-WMF
ResolvedJdforrester-WMF
OpenNone

Event Timeline

daniel created this task.Feb 21 2018, 7:57 PM
daniel triaged this task as Normal priority.
Anomie added a subscriber: Anomie.Feb 22 2018, 1:36 AM

A straight forward approach to this would be passing RevisionSlots (including inherited slots, after PST) to ContentHandler::getParserOutput. The relevant code is in WikiPage::prepareContentForEdit (resp. PageUpdater::prepareContentForEdit).

Note that there's plenty of other code that calls Content::getParserOutput().

Chances are the better method for doing it is to go via Parser::fetchCurrentRevisionOfTitle(), or directly through ParserOptions::getCurrentRevisionCallback() if a Parser isn't available.

Lydia_Pintscher moved this task from incoming to monitoring on the Wikidata board.Apr 23 2018, 7:28 AM