Steps to replicate the issue
- In wikitext, create a page with:
- An infobox (or any other template) which includes a (main) reference
- Make sure the reference uses a template, e.g. a standard citation template like {{cite book}}
- Add a sub-reference to the article text
- Example:
{{Infobox album
| Artist = Artist name<ref name="Test">{{cite book |last1=Playfair |first1=I. S. O. |author-link1=Ian Stanley Ord Playfair |last2=Stitt |first2=G. M. S. |date=2004 |orig-date=1st pub. [[HMSO]]:1954 |editor-last=Butler |editor-first=J. R. M. |editor-link=James Ramsay Montagu Butler |title=Mediterranean and Middle East Volume I |isbn=1-845740-65-3}}</ref>
}}
Article text.<ref name="Test" details="page 2" />
== References ==
<references />- Edit the page in VisualEditor and make any minor edit in the article text
What happens?
- Everything looks normal while editing in VE. When saving the edit, the main ref content gets copied to the sub-ref in the article text (and T403379 occurs)
- But in this variation of T412007: VE unexpectedly copies reference content from one sub-ref to another if the main ref is defined within a template the copied main reference content is terribly broken because the reference used a template instead of just <ref>Plain text</ref>. Example:
{{Infobox album
| Artist = Artist name<ref name="Test">{{cite book |last1=Playfair |first1=I. S. O. |author-link1=Ian Stanley Ord Playfair |last2=Stitt |first2=G. M. S. |date=2004 |orig-date=1st pub. [[HMSO]]:1954 |editor-last=Butler |editor-first=J. R. M. |editor-link=James Ramsay Montagu Butler |title=Mediterranean and Middle East Volume I |isbn=1-845740-65-3}}</ref>
}}
Article text.<ref name="Test" details="page 2"><templatestyles src="Module:Citation/CS1/styles.css"></templatestyles><cite id="CITEREFPlayfairStitt2004" class="citation book cs1">[[Ian Stanley Ord Playfair|Playfair, I. S. O.]]; Stitt, G. M. S. (2004) [1st pub. [[HMSO]]:1954]. [[James Ramsay Montagu Butler|Butler, J. R. M.]] (ed.). ''Mediterranean and Middle East Volume I''. [[ISBN (identifier)|ISBN]] [[Special:BookSources/1-845740-65-3|<bdi>1-845740-65-3</bdi>]].</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Mediterranean+and+Middle+East+Volume+I&rft.date=2004&rft.isbn=1-845740-65-3&rft.aulast=Playfair&rft.aufirst=I.+S.+O.&rft.au=Stitt%2C+G.+M.+S.&rfr_id=info%3Asid%2Ftest.wikipedia.org%3AUser%3AJohannes+Richter+%28WMDE%29%2Ftest8" class="Z3988"></span></ref>
Minor test edit without touching any ref.
== References ==
<references>
</references>What should have happened instead?
- <ref name="Test" details="page 2" /> should have stayed the way it was. If copying content can't be avoided, at least the template shouldn't break...
Other information
- Saving the page leads to an reference error in reader's view because the copied content is obviously different from the first reference:
- Initially observed in this dewiki article and reported on my talk page
- The issue wouldn't appear if the main ref was part of the article content and the infobox would just re-use the main ref. But reference content is usually defined when it's first used in an article – in quite a large number of articles that's the infobox...
- Created a sub-ticket of T412007 because this variation of the bug leads to more severe consequences


