Page MenuHomePhabricator

VE is transforming citation templates into formatted text with "cite class" tags (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 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.

That last diff (Roman Sondermajer) looks like a different "problem", namely that the editor manually created a basic citation. There's no template substing going on in any of these (see this edit to find out what happens when you subst a CS1 template), but the 4 October 2019 example doesn't look like a software problem at all.

Whatamidoing-WMF renamed this task from VE is "substing" citation templates (when copying a reference defined within template-generated reflist) to VE is transforming citation templates into formatted text with "cite class" tags (when copying a reference defined within template-generated reflist).Oct 22 2019, 6:03 PM

You're right, "substed" is not quite correct, but somehow, "templatestyles src="Module:Citation/CS1/styles.css" " is getting into the wikicode. I don't imagine that editors are typing that themselves manually, especially editors prone to using VE, so some interaction between the actions of the human editor and VE's programming are probably causing this bug.

Similar bugs appear to be related to copy/paste activity.

Change 561988 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/Cite@master] Don't process references defined inside template-generated reflists

https://gerrit.wikimedia.org/r/561988

matmarex claimed this task.Jan 4 2020, 3:11 PM

This turns out to be a one-line patch, but it took a lot of debugging before I found that out, heh.

Change 561988 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] Don't process references defined inside template-generated reflists

https://gerrit.wikimedia.org/r/561988

Ryasmeen edited projects, added Verified; removed Editing QA.Jan 16 2020, 9:34 PM
Ryasmeen moved this task from QA to Product owner review on the VisualEditor (Current work) board.
ppelberg closed this task as Resolved.Jan 21 2020, 1:50 AM
Izno added a comment.Sat, Oct 3, 7:15 PM

Though, it looks like that issue was caused by copy-pasting from another wiki?