Page MenuHomePhabricator

VisualEditor doesn't colon-prefix interwiki links when needed, causing them to become language links
Closed, DuplicatePublic

Description

Go to a Flow topic on mw.org, click reply and try to create a link to "en:Wikipedia:Indentation". VisualEditor will show a working link, but when the comment is saved, the link disappear, because it is an interwiki link, and the user should prefix it with ":" in order to make it visible.

Example:
https://www.mediawiki.org/w/index.php?title=Topic:Sil245ohqek5jnrg&action=compare-post-revisions&topic_newRevision=silo7kmiy9wqvwkn

Event Timeline

He7d3r created this task.Jun 4 2015, 3:48 PM
He7d3r raised the priority of this task from to Needs Triage.
He7d3r updated the task description. (Show Details)
He7d3r added a subscriber: He7d3r.
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptJun 4 2015, 3:48 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Catrope added a subscriber: Catrope.Jun 4 2015, 4:38 PM

Is this a bug in VisualEditor, perhaps? Or in Parsoid? Does it happen when editing article pages with VE?

He7d3r added a comment.EditedJun 4 2015, 5:47 PM

I can't really test, because I'm getting

TypeError: $trigger.data(...).$dialog is undefined load.php:4:588
"Exception in store-localstorage-update:" load.php:177:555
"NS_ERROR_DOM_QUOTA_REACHED: Persistent storage maximum size reached" DOMException >[NS_ERROR_DOM_QUOTA_REACHED: "Persistent storage maximum size reached"
code: 1014
nsresult: 0x805303f6
location: https://pt.wikipedia.org/w/load.php?debug=false&lang=pt-br&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=4%2BsuyLdS:175]

when I access
https://pt.wikipedia.org/w/index.php?title=Usu%C3%A1rio%28a%29:He7d3r/Testes&veaction=edit
using Firefox 38 on linux.

TypeError: $trigger.data(...).$dialog is undefined load.php:4:588

Ouch, that sounds like a local script / user script / Gadget error. It doesn't happen for me; maybe you could try logged-out or using incognito?

He7d3r added a comment.EditedJun 4 2015, 6:00 PM

Apparently, that comes from

$trigger.data('callout').$dialog.find('li.cx-campaign-translations').replaceWith(getTranslationsItem());

https://github.com/wikimedia/mediawiki-extensions-ContentTranslation/blob/88324ec56bd780ce1d27df70c819a8a165181990/modules/campaigns/ext.cx.campaigns.contributionsmenu.js#L123
because VisualEditor works again if I disable the beta feature on
https://pt.wikipedia.org/wiki/Special:Preferences#mw-prefsection-betafeatures

However, I was able to reproduce the problem reported here, i.e., I saw a working link when I added "en:Test" to my page:
https://pt.wikipedia.org/w/index.php?diff=42517031
As soon as I saved the page, the link disappears (as expected), so VisualEditor is not being good at showing how the page will look like after the edit is saved.

Catrope renamed this task from Flow preview doesn't show that interwiki links will disappear if saved without a ":" prefix to VisualEditor doesn't colon-prefix interwiki links when needed, causing them to become language links.Jun 4 2015, 8:20 PM

https://www.mediawiki.org/w/index.php?title=User:Catrope/Sandbox&diff=1666237&oldid=1656914 shows that this only happens when you try to make an internal link to de:Foo. If you make an external link to http://de.wikipedia.org/wiki/Foo instead, VE correctly produces a link to :de:Foo.