Page MenuHomePhabricator

VE unexpectedly copies reference content from one sub-ref to another if the main ref is defined within a template
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue
  • Create a page using a sub + main reference defined within a template. Example:
{{Infobox Unternehmen  <!--  Any template reproduces the issue, but infoboxes are the most frequent use case -->
|Gründungsdatum =<ref name="Test" details="S. 1">Test</ref>
}}

== Test ==
Test.<ref name="Test" details="S. 2" />

== Einzelnachweise ==
<references />

Screenshot from 2025-12-08 12-22-34.png (257×1 px, 21 KB)

  • Edit the page in VisualEditor and make any minor edit in the article text.
What happens?
  • Notice how VE shows the main ref content but not the first sub-ref (S. 1) – that's not very surprising because VE always struggles with refs inside templates (e.g. T350064 / T355858)

Screenshot from 2025-12-08 11-06-25.png (282×1 px, 20 KB)

{{Infobox Unternehmen
|Gründungsdatum =<ref name="Test" details="S. 1">Test</ref>
}}

== Test ==
TestTest.<ref name="Test" details="S. 2">Test</ref>

== Einzelnachweise ==
<references>
</references>
What should have happened instead?
  • <ref name="Test" details="S. 2" /> should have stayed the way it was instead of changing to <ref name="Test" details="S. 2">Test</ref>
Other information
  • Copying main ref content to another sub-ref increases the risk of reference errors – next time I edit the main ref without realizing there's a second sub-ref with main ref content it will lead to a reference error (example) – which I might not even notice because VE doesn't show it while editing. Reader's view after saving the page:

Screenshot from 2025-12-08 12-21-13.png (298×1 px, 35 KB)

  • VE behaves differently if the main ref is just a re-used ref without sub-references. Example:
{{Infobox Unternehmen
|Gründungsdatum =<ref name="Test">Test</ref>
}}

== Test ==
Test.<ref name="Test" />

== Einzelnachweise ==
<references />
  • Leads to this view while editing in VE:

Screenshot from 2025-12-08 11-06-29.png (282×1 px, 35 KB)

  • ... which does not result in any changes to the references (example) – the reported issue is specific to sub-refs defined within templates.
Next steps
  • Investigate the root issue
  • Discuss possible solutions

Event Timeline

DLynch subscribed.

Another reference-defined templates issue that's difficult to solve until we get T404608 or something similar to it from Content-Transform-Team.