Page MenuHomePhabricator

Templatesused when editing old revision includes templates on current revision
Open, Needs TriagePublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Assume their is a page A with oldid=5
  • Add a template in A, and current oldid=6
  • Edit the previous revision 5 (their should be a editingold notice above the edit box)

What happens?:
The newly added template appears inside templatesused section.

What should have happened instead?:
It should not.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
1.38.0-wmf.22 (529f223)

Event Timeline

This is expected from a performance point of view.

When open the edit form for the current page the "template used" section is selecting the database table templatelinks to get a list of it and add them to the page.
When open the edit form for an old revision, there is no information available about the used templates and nothing is shown. If the page gets previewed, this information are available from the parse and added to the form.
The parse is expensive in cpu and time and should be avoided for the inital edit form.

You can try to bypass this with the user preferences about direct preview (called "Show preview on first edit" on the editing section).

From the begin of the edit form and now there are some improvements on the parser side. I have no idea if it is okay to do a "metadata" parse on the first view of the edit form to get the necessary information. The typical html parse is not needed (expect the mention preferences is in active, than the alone metadata parse is not needed). Maybe this is something for the miser mode flag to hide it for performance reason on wmf wikis.
This are the same reasons as for T302177