Page MenuHomePhabricator

Visual Editor unable to copy and paste a citation between articles
Open, Needs TriagePublic

Description

I was trying to copy and paste from

https://en.wikipedia.org/w/index.php?title=Meringandan&oldid=925489346

Specifically the 2nd sentence in the lede para, "At the 2011 census, Meringandan ..." including its citation.

OK, I opened it in the Visual Editor, selected and copied it.

I then went to paste it using the Visual Editor into the then current version of that article into the History section. No citation was copied. I thought I must have not selected the citation when I copied. So I went back and repeated the copy making sure that I had dragged across to include the citation. Note that in the Visual Editor the selection of a citation at the end of the sentence is not visually highlighted so missing it can easily happen (aside, could this please be fixed!). Again, the paste failed to bring across the citation. I tried pasting into my user page (in case it was a problem due to being a different version of the same article). Still no citation.

FYI The wikitext was

At the [[Census in Australia#2011|2011 census]], Meringandan had a population of 305.<ref name="census11"/>

I went back and this time selected the sentence and the citation right through to the following heading so there could be no question that I had selected the citation. Again, no citation was pasted but yes the heading was pasted.

Now I had been doing some similar edits a few minutes earlier without problem. e.g.

https://en.wikipedia.org/w/index.php?title=Atherton,_Queensland&diff=prev&oldid=933499193
https://en.wikipedia.org/w/index.php?title=Brigalow,_Queensland&diff=prev&oldid=933499033

but when I look at the wikitext I was copying it was

At the [[Census in Australia#2011|2011 census]], Atherton had a population of 7,287.<ref name="ABS">{{Census 2011 AUS|id=SSC30065 |name=Atherton (State Suburb) |accessdate=13 February 2015 |quick=on}}</ref>
At the [[Census in Australia#2011|2011 census]], Brigalow and the surrounding area had a population of 404.<ref name="ABS">{{Census 2006 AUS|id=SSC35387|name=Brigalow (Chinchilla Shire) (State Suburb)|accessdate=2009-03-31|quick=on}}</ref>

Spot the difference. These citations were not reuse of another citation. This appears to be the point of difference.

Now I copy article content with citations around all the time in the Visual Editor. I can't imagine that I have never stumbled on this bug before now so I think it must have been introduced recently. I have not been that active on-wiki over the past month due to summer holidays, so maybe over that time frame.

Event Timeline

Restricted Application added a project: VisualEditor. · View Herald TranscriptJan 1 2020, 11:07 AM
Restricted Application added subscribers: Liuxinyu970226, Aklapper. · View Herald Transcript

Note that in the Visual Editor the selection of a citation at the end of the sentence is not visually highlighted so missing it can easily happen (aside, could this please be fixed!).

I had a look at this part first :) I think we can actually fix it. I filed a separate task for this T241880 so that it's easier for us to track.

matmarex updated the task description. (Show Details)Jan 4 2020, 1:14 PM

So the problem with this specific reference is not just that it's reused, but it's also defined within a template, which means that VE can't access its contents.

{{Infobox Australian place
...
| pop_footnotes            = <ref name="census11">{{Census 2011 AUS|id=SSC31042 |name=Meringandan (State Suburb) |accessdate=1 July 2013 |quick=on}}</ref>
...
}}
'''Meringandan''' is ... At the [[Census in Australia#2011|2011 census]], Meringandan had a population of 305.<ref name="census11"/>

The editor displays a note in the context menu about this:


Since we can't access its contents, this also makes it impossible to copy-paste it into another editor.

I don't think we can do anything about this. Dealing with references inside templates is generally a difficult problem for VE. There are many related old tasks about this, e.g. T67301.

We could tweak the text in the context menu, but I'm not sure how to concisely describe this limitation.

VE does not display that note when you are copying. At least if it did that, it warns the user that there is some problem.

But lots of infoboxes have citations within them, many have fields for that purposes, e.g. {{Infobox Australian place}} has several fields intended for citations to support the facts in the infobox. Can we really walk away from this saying VE can't do it?

Can someone explain why it's a difficult problem? I can understand it's a difficult problem if the enclosing template was constructing the citation as part of the template instantion and hence the citation definition in wikitext does not appear as a well-formed citation. But in this infobox case, the citation is not being constructed by the infobox, rather it is just "payload" in a field value and appears quite well-formed?

<ref name="census11">{{Census 2011 AUS|id=SSC31042 |name=Meringandan (State Suburb) |accessdate=1 July 2013 |quick=on}}</ref>

During Triage it was determined that @ppelberg will create a task for @iamjessklein to surface the lack of feedback contributors receive when trying to copy and paste references into VE. Additionally, @matmarex will respond to @Kerry_Raymond.

But lots of infoboxes have citations within them, many have fields for that purposes, e.g. {{Infobox Australian place}} has several fields intended for citations to support the facts in the infobox. Can we really walk away from this saying VE can't do it?
Can someone explain why it's a difficult problem? I can understand it's a difficult problem if the enclosing template was constructing the citation as part of the template instantion and hence the citation definition in wikitext does not appear as a well-formed citation. But in this infobox case, the citation is not being constructed by the infobox, rather it is just "payload" in a field value and appears quite well-formed?

Unfortunately right now, the two cases you describe are basically the same from VisualEditor's perspective. We have no way to "connect" the template's output to the template parameters, so we don't know that the reference was generated from that template parameter, even though it's obvious to a person.

Task T52355 would probably be a pre-requisite for improving that. Task T52896 is maybe also related.

matmarex moved this task from To Triage to Triaged on the VisualEditor board.Wed, Feb 12, 5:24 PM