Steps to replicate the issue:
- Create a test page (on dewiki or any other wiki using sub-references) with the following wikitext
{{Infobox Organisation
|Name=<ref name="Test">Example</ref>
}}
Content.<ref name="Test" />
== References ==
<references />-> https://de.wikipedia.org/w/index.php?title=Benutzer:Johannes_Richter_(WMDE)/Test11&oldid=265795643
- Edit the page in VE (which leads to the known issue T350064: References defined in templates disappear or render differently in Edit mode compared to Read mode)
- Copy and paste the footnote [1] next to "Content"
- Add sub-reference details to the first instance of that re-used reference outside of the template
What happens?:
- Everything works as expected while re-using the reference
- Adding sub-ref details works as well
- Check the wikitext changes before saving the edit – notice that "Test2" doesn't just appear as sub-ref details, but also as a main reference (and the known issue T403379: VisualEditor automatically writes out self enclosed <references /> tags (unintended diff) occurs)
- Save the edit and notice the reference error, because the main ref has been defined 2x now (with different content)
-> https://de.wikipedia.org/w/index.php?title=Benutzer:Johannes_Richter_(WMDE)/Test11&oldid=265795740
{{Infobox Organisation
|Name=<ref name="Test">Example</ref>
}}
Content.<ref name="Test" details="Test2">Test2</ref><ref name="Test" />
== References ==
<references></references>- Edit the page again and notice that VE now shows the initial main ref content (even though that's still defined within a template)
What should have happened instead?:
- Don't copy sub-ref details as main ref content
{{Infobox Organisation
|Name=<ref name="Test">Example</ref>
}}
Content.<ref name="Test" details="Test2" /><ref name="Test" />
== References ==
<references></references>- Don't show the initial main ref content in VE when editing again while there are two main refs with the same name
Other information:
- Notice that the issue doesn't appear if you add sub-ref details to the second reference instead – it's just the first re-used reference leading to sub-ref details copied as main ref content.
- Another variation of T412007: VE unexpectedly copies reference content from one sub-ref to another if the main ref is defined within a template / T419035: VE tries to copy content to a sub-ref if the main ref is defined within a template – but delivers broken wikitext if the main ref uses a template








