Page MenuHomePhabricator

VE is "substing" citation templates (when copying a reference defined within template-generated reflist)
Open, Needs TriagePublic

Description

... and we don't know why. See edit one and a second edit here.

See also this permalink to research TTM has done.

Event Timeline

Izno created this task.Nov 14 2018, 3:17 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 14 2018, 3:17 PM
Izno updated the task description. (Show Details)Nov 14 2018, 3:58 PM
Mvolz added a subscriber: Mvolz.Nov 14 2018, 5:16 PM
JTannerWMF moved this task from To Triage to Bug Fixes on the VisualEditor board.Nov 15 2018, 1:52 PM

Apparently the bug is not yet dead. This one popped up this morning

A common component of these failures appears to be that the references are named.

This edit at We Are the Romans was apparently made by copy/paste from one article to another using ve. related to the original issue? I don't know but clearly a failure of ve that needs fixing. Discussion about that edit is at the editor's talk page.

ssastry moved this task from Backlog to Non-Parsoid Tasks on the Parsoid board.Dec 12 2018, 3:07 PM
ssastry added subscribers: JTannerWMF, ssastry.

@JTannerWMF For now, I moved this to the non-parsoid tasks column on the phab board. This substing looks like a VE issue as far as I can tell. Parsoid won't subst a template unless the template annotations are missing or get dropped. But, if your investigation points at Parsoid, we'll take a look.

May also happen with 2017 wikitext editor. This page creation page creation has text and citations that appear to have been copy/pasted from Venom (2018_film).

marcella moved this task from Bug Fixes to Q4 on the VisualEditor board.Dec 13 2018, 6:26 PM
JTannerWMF moved this task from Q4 to Up next on the VisualEditor board.Jan 16 2019, 7:01 PM

I thought this task might be related to T207303, but on closer look it doesn't look related. That problem affected existing references, while this one affects newly inserted ones.

Investigating copy/paste was a good idea. The problem is reproducible with this small page:
https://en.wikipedia.org/w/index.php?title=User:Matma_Rex/sandbox&oldid=878784265&veaction=edit

foo<ref name=a />

{{Reflist|refs=
<ref name=a>{{Cite book|title=Blah|last=Smith|first=John|publisher=|year=|isbn=|location=|pages=}}</ref>
}}

When you copy-paste this reference from VE to another VE (or to NWE), it gets "substed":

<ref name="a"><cite class="citation book">Smith, John. ''Blah''.</cite><templatestyles src="Module:Citation/CS1/styles.css"></templatestyles></ref>

To cause the problem, the reference must be defined within a references block using {{Reflist|…}}, rather than within text. (Also, the references block must be defined using a template, <references>…</references> does not cause the problem: https://en.wikipedia.org/w/index.php?title=User:Matma_Rex/sandbox&oldid=878784347.)


Additionally, the reference is not editable like a normal "cite book" template in VE, and trying to edit it in this broken state has no effect (changes are ignored when saving the page).

Parsoid does not provide information about templates used within individual references here, because the entire reflist containing them is a template. I think we might have to make these references non-editable within VE (same as when a reference is defined e.g. within an infobox parameter, and reused in the article). Not sure how easy that would be to do.

matmarex renamed this task from VE is substing citation templates to VE is "substing" citation templates (when copying a reference defined within template-generated reflist).Jan 16 2019, 10:47 PM
matmarex added a project: Cite.
Izno moved this task from Unsorted backlog to External on the Cite board.Jan 19 2019, 1:29 AM

Another instance of this was reported by @Lfstevens: https://www.mediawiki.org/wiki/Topic:Uulh8h1z2mufkpp4

It addtionally has the ref names being changed (a '2' being appended for no apparent reason).

Beijing-Zhangjiakou Railway, The Tomb of Lu Xun, and Zeng Fengnian all exhibit similar issues to the issues described by this ticket – all have html versions of what should be cs1|2 templates (ctrl-f search the source for cite class. These articles were created with Content_translation and Content_translation/V2 – the first two were translated this month and the last one was translated in 2016.