Page MenuHomePhabricator

Flow: Interlanguage links are losing the :colon prefix when saved
Closed, DuplicatePublic

Description

If I type this in a post:
[[:en:Foo bar]]
it gets saved as:
[[en:Foo bar]]

It should preserve the :colon prefix.

[Further detail. Possibly a separate bug, or it's an intended effect?]

If I then edit that post, and just add ", true" after the link, it gets saved as:
http://en.wikipedia.org/wiki/Foo bar, true
which renders as
, true
Eg https://www.mediawiki.org/w/index.php?title=Talk:Flow_QA&topic_newRevision=rplry5w6txhfutf1&topic_oldRevision=rplrxf88a3ptg6wp&workflow=rplqjkun4mxieeac&action=compare-revisions


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=51442

Details

Reference
bz61725

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:58 AM
bzimport set Reference to bz61725.
bzimport added a subscriber: Unknown Object (MLST).

Possibly related to Parsoid's bug 51442 ?

on second look..this may be parsoid related but not entirely sure.

Using the round trip form ( http://parsoid.wmflabs.org/_rtform/ ) this looks to work correctly.

On the other hand manually round tripping at http://parsoid.wmflabs.org/_wikitext/:

[[:en:Foo bar]]

results

<p data-parsoid='{"dsr":[0,15,0,0]}'><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo%20bar" data-parsoid='{"stx":"simple","a":{"href":"http://en.wikipedia.org/wiki/Foo bar"},"sa":{"href":":en:Foo bar"},"isIW":true,"dsr":[0,15,2,2]}'>en:Foo bar</a></p>

Which when provided to http://parsoid.wmflabs.org/_html/ gives me back:

[[en:Foo bar]]

Getting stranger. This bug now only seems to affect certain interwiki links. fr: confirmed.

Detail:
When I add "[:fr:Athérure]" it gets saved as "[fr:Athérure]", and then if I edit the post again it gets saved as "[http://fr.wikipedia.org/wiki/Athérure]"

But if I add "[:de:Zufall]" it gets correctly saved as "[:de:Zufall]"

Test case here: https://www.mediawiki.org/w/index.php?title=Talk:Sandbox&topic_postId=rsg1m81vskkdywgk&workflow=rsftpxbkjdg745zu#flow-post-rsg1m81vskkdywgk

and another editor battling the problem here: https://www.mediawiki.org/w/index.php?title=Talk:Beta_Features/Hovercards&topic_postId=rs2kexhb014dx2d8&workflow=rs2kexh7vs938oxo&action=history

(Possibly this bug should be reassigned to Parsoid?)

I think the accents in [[:fr:Athérure]] and [[:fr:Porc-épic]] are the key. [[:en:Foo bar]] now works, it preserves the leading colon.

To reproduce in Parsoid, copy the following three lines:

[[:fr:Athérure]] and [[:fr:Porc-épic]] lose the leading colon.
May be it's the accent since [[:fr:Bonjour]] is OK.
[[:en:Foo bar]] used to not work...

If you send it through http://parsoid.wmflabs.org/_rtform/ , it claims the resulting wikitext is identical.

But in Flow, if you put this in a post, then when you later edit this post, the leading colon from the accented links is gone from the wikitext.

The API call Flow makes is

https://www.mediawiki.org/w/api.php?action=query&format=json&list=flow&flowpage=Talk%3ASandbox&flowworkflow=rsftpxbkjdg745zu&flowparams={%22topic%22%3A{%22postId%22%3A%22rskn5smwrffhalus%22%2C%22contentFormat%22:%22wikitext%22}}

which makes Flow ask Parsoid to convert the HTML to wikitext, and the accented links have lost the leading colon.

parsoid interwiki links was recently changed, gerrit I86024ff038

Trizek-WMF added a project: Regression.
Trizek-WMF subscribed.

Reopening: the colon has been missing on two posts, as reported here.

Reopening: the colon has been missing on two posts, as reported here.

Are you sure this is the same bug? This bug complained about the user writing [[:en:Foo]] in wikitext and it saving as [[en:Foo]]. That is not my experience; instead, my experience is that VE saves [[en:Foo]] instead of [[:en:Foo]] in some cases, because of T95850: Parsoid does not escape language prefixes in internal link hrefs, causing html2html round-trip failures

That current task matches the description of what I've experienced. That was not the case yesterday.

It happened to me and to other people that we write [[:en:Jodrell Bank Observatory]] and it's saved as [[En:Jodrell Bank Observatory]]. See the history of https://www.mediawiki.org/wiki/Topic:Tk3wth4pc03wj1gn .

... More precisely, that user used the visual editor in Flow and typed :en:Jodrell Bank Observatory as the link target in the inspector, but it was saved as [[En:Jodrell Bank Observatory]]. This causes the link not to appear at all in the text because it is interpreted as an interlanguage link to be shown in the sidebar, which is absolutely not the user's intention.

... More precisely, that user used the visual editor in Flow and typed :en:Jodrell Bank Observatory as the link target in the inspector, but it was saved as [[En:Jodrell Bank Observatory]]. This causes the link not to appear at all in the text because it is interpreted as an interlanguage link to be shown in the sidebar, which is absolutely not the user's intention.

Right, so that is in fact precisely the same as T95850: Parsoid does not escape language prefixes in internal link hrefs, causing html2html round-trip failures.