Page MenuHomePhabricator

TemplateSandbox doesn't handle things like #ifexist and Scribunto's getContent
Closed, ResolvedPublic

Description

When previewing a page with TemplateSandbox, if getContent() is called on the page in question, it will incorrectly return the stored content rather than the content provided by TemplateSandbox.


Version: unspecified
Severity: normal

Details

Reference
bz70495

Related Objects

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:54 AM
bzimport set Reference to bz70495.

Changing to a TemplateSandbox bug, since this affects other things too, like #ifexist. The problem is that there's a lot of ways that one page can interact with another, and the only one TemplateSandbox catches is transclusion.

gerritadmin wrote:

Change 160546 had a related patch set uploaded by Jackmcbarn:
Add TitleExists hook

https://gerrit.wikimedia.org/r/160546

gerritadmin wrote:

Change 160549 had a related patch set uploaded by Jackmcbarn:
Call Title::exists() instead of checking the ID

https://gerrit.wikimedia.org/r/160549

gerritadmin wrote:

Change 160550 had a related patch set uploaded by Jackmcbarn:
Call Title::exists() instead of checking the ID

https://gerrit.wikimedia.org/r/160550

gerritadmin wrote:

Change 160555 had a related patch set uploaded by Jackmcbarn:
Hook TitleExists when previewing

https://gerrit.wikimedia.org/r/160555

The exists problem and the getContent problem turn out to have totally separate fixes. The above 4 patches fix the exists problem; the next set of patches will fix the getContent problem.

gerritadmin wrote:

Change 160570 had a related patch set uploaded by Jackmcbarn:
Add RevisionFromTitle hook

https://gerrit.wikimedia.org/r/160570

gerritadmin wrote:

Change 160572 had a related patch set uploaded by Jackmcbarn:
Use RevisionFromTitle instead of a template callback

https://gerrit.wikimedia.org/r/160572

All of the patches needed to fix this are now uploaded.

gerritadmin wrote:

Change 160549 merged by jenkins-bot:
Call Title::exists() instead of checking the ID

https://gerrit.wikimedia.org/r/160549

gerritadmin wrote:

Change 160546 merged by jenkins-bot:
Add TitleExists hook

https://gerrit.wikimedia.org/r/160546

gerritadmin wrote:

Change 160555 merged by jenkins-bot:
Hook TitleExists when previewing

https://gerrit.wikimedia.org/r/160555

gerritadmin wrote:

Change 160570 merged by jenkins-bot:
Add parser callback to get a page's current revision

https://gerrit.wikimedia.org/r/160570

gerritadmin wrote:

Change 160550 merged by jenkins-bot:
Improve compatibility with TemplateSandbox

https://gerrit.wikimedia.org/r/160550

gerritadmin wrote:

Change 160572 merged by jenkins-bot:
Use current revision callback instead of template callback

https://gerrit.wikimedia.org/r/160572

Per my comments at gerrit 857546, this has regressed. I confirmed in production that {{#ifexist}} on the template being edited, before template creation, will show the template as not existing. Title::exists() is never reached because the title is already in the link cache.

getContent() still works.