Page MenuHomePhabricator

Live Preview does not show the "Templates used in this preview" when section-editing
Closed, ResolvedPublic

Description

Without Live Preview:

With Live Preview, I don't get that list of templates/transclusions in the section-editing scenario.


See also: T2878: "Templates used on this page" on section edit should show templates used in the section at initial edit as well as preview

Event Timeline

Quiddity raised the priority of this task from to Needs Triage.
Quiddity updated the task description. (Show Details)
Quiddity subscribed.
Quiddity set Security to None.
SD0001 triaged this task as Medium priority.Apr 18 2020, 11:57 AM
SD0001 subscribed.

The problem appears to be on line 207:

$editform.find( '.templatesUsed .mw-editfooter-list' ).detach().empty().append( newList ).appendTo( '.templatesUsed' );

This is assuming that $editform.find( '.templatesUsed .mw-editfooter-list' ) exists. But that's correct only while editing the whole page. While editing a section, .templatesUsed exists but is an empty div.

The code from non-live preview that constructs the div is at TemplatesOnThisPageFormatter.php which looks like lot to port to JavaScript.

@SD0001: Hi, do you plan to work on fixing this task, as you increased the priority of this task? If so, please set yourself as task assignee - thanks!

SD0001 raised the priority of this task from Medium to Needs Triage.Apr 19 2020, 9:27 AM

Change 631906 had a related patch set uploaded (by Gerrit Patch Uploader; owner: Nardog):
[mediawiki/core@master] LivePreview: Show "Templates used in this preview" when creating a new page or editing a section

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

Change 631906 merged by jenkins-bot:
[mediawiki/core@master] LivePreview: Show "Templates used in this preview" when creating a new page or editing a section

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

matmarex assigned this task to Nardog.
matmarex subscribed.

Thank you for the patch @Nardog!