Page MenuHomePhabricator

Adding wikilinks to citations leads to weird link behaviour
Closed, ResolvedPublic1 Story Points

Description

Editing a citation inserted in VisualEditor results in some odd link behaviour within the popup "preview" window. Here's a workflow for recreation, since that seems the easiest way to explain what's going on here:

  • I add a citation using the "Cite" button on VisualEditor, and save the generated output.
  • I go back in and edit the citation, adding a wikilink (e.g. in the "website" or a "publication" parameters).
  • The link to the work/publication in the popup preview now links somewhere it shouldn't.

Here's a screenshot from editing the page https://en.wikipedia.org/wiki/User:JSutherland_(WMF)/sandbox :


For the link to "Reuters" the expected behaviour is a link to https://en.wikipedia.org/wiki/Reuters. Instead, the actual behaviour is that it links to https://en.wikipedia.org/wiki/User:JSutherland_(WMF)/Reuters for some reason.

In the main namespace it's even weirder, as in this example from editing https://en.wikipedia.org/wiki/KRFF-LP :


The wikilink to "Radio Free Fargo 95.9" (that is, the darker blue one in italics, not the lighter one in quotes) should direct me to https://en.wikipedia.org/wiki/Radio_Free_Fargo_95.9 but actually directs me to https://en.wikipedia.org/w/Radio_Free_Fargo_95.9 (note the "w", rather than "wiki") - a page which displays a 404 error.

(NB: I'm not sure if this is actually Citoid or VisualEditor. Please do feel free to mercilessly alter the tags.

Event Timeline

jrbs created this task.Dec 7 2016, 11:49 PM
Restricted Application added a project: VisualEditor. · View Herald TranscriptDec 7 2016, 11:49 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
jrbs renamed this task from Editing citations leads to weird link behaviour in Citoid to Adding wikilinks to citations leads to weird link behaviour.Dec 7 2016, 11:50 PM
jrbs updated the task description. (Show Details)

Change 326278 had a related patch set uploaded (by Alex Monk):
Resolve URLs in preview elements

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

AlexMonk-WMF edited projects, added Cite; removed Citoid.Dec 10 2016, 5:56 PM
AlexMonk-WMF added a subscriber: AlexMonk-WMF.

It's actually the Cite extension (not the Citoid one) detecting a reference, then trying to render it using VE code that seems to have an issue.

Additionally it seems the best place to fix this is in VE core rather than VE-MW. Not 100% sure about that though.

Change 326298 had a related patch set uploaded (by Catrope):
Allow ve.resolveAttributes() to take a single element

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

Change 326278 abandoned by Alex Monk:
Resolve URLs in preview elements

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

Change 326298 merged by jenkins-bot:
Allow ve.resolveAttributes() to take a single element

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

Change 326470 had a related patch set uploaded (by Jforrester):
Update VE core submodule to master (721f591)

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

Change 326470 merged by jenkins-bot:
Update VE core submodule to master (721f591)

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

Jdforrester-WMF closed this task as Resolved.Dec 12 2016, 5:41 PM
Jdforrester-WMF assigned this task to Catrope.
Jdforrester-WMF triaged this task as High priority.
Jdforrester-WMF moved this task from To Triage to TR1: Releases on the VisualEditor board.
Jdforrester-WMF set the point value for this task to 1.