Page MenuHomePhabricator

[Regression?] Links in transclusion nodes can point to /w/PageName if browsing from /w/index.php?veaction=edit
Closed, ResolvedPublic

Description

Okay, here's the weird bug I mentioned in KIT today:
I found that when I browse to /w/index.php?title=SomePage&veaction=edit (that is, not /wiki/SomePage?veaction=edit) and try to add transclusions with links inside them (e.g. to TargetPage), they point to /w/TargetPage, which is invalid.

  • It wouldn't surprise me if this is a duplicate.
  • Don't we deal with this anywhere else?
  • The problem begins with our call to $.parseHTML in MWTransclusionNode#onParseSuccess, which takes all of Parsoid's ./TargetPage links and generates DOM link elements assuming they are relative to the current URL.

Roan's notes from IRC:

<RoanKattouw> Yeah there is something somewhere to do href remapping
<RoanKattouw> Waait
<RoanKattouw> GeneratedContentNode already does href computation
<RoanKattouw> This should be *working*
<RoanKattouw> See ve.ce.GeneratedContentNode.prototype.getRenderedDomElements and the stuff about computed attributes
<RoanKattouw> I first thought that we should be computing attributes after cloning into the right document, but that's wrong, because that's cloning into the view document
<RoanKattouw> We need to resolve with respect to the model document
<RoanKattouw> Which... oooh but they're not in the right document at that time, I guess?

Details

Related Gerrit Patches:

Event Timeline

Krenair created this task.Dec 1 2014, 7:53 PM
Krenair raised the priority of this task from to Needs Triage.
Krenair updated the task description. (Show Details)
Krenair changed Security from none to None.
Krenair added subscribers: Krenair, Catrope, Krinkle.
Jdforrester-WMF renamed this task from Links in transclusion nodes can point to /w/PageName if browsing from /w/index.php?veaction=edit to [Regression?] Links in transclusion nodes can point to /w/PageName if browsing from /w/index.php?veaction=edit.Dec 1 2014, 8:58 PM
Jdforrester-WMF triaged this task as High priority.

Change 177875 had a related patch set uploaded (by Alex Monk):
Try to fix href parsing in transclusion nodes when on alternative (e.g. mobile) domains/paths

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

Patch-For-Review

Krenair claimed this task.Dec 5 2014, 10:04 PM

Change 177875 merged by jenkins-bot:
Fix href parsing in transclusion nodes when on alternative (e.g. mobile) domains/paths

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