Last modified: 2013-12-06 21:55:14 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T58988, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56988 - page links in Flow are parsed as relative hrefs, so they break in permalink, history and other views
page links in Flow are parsed as relative hrefs, so they break in permalink, ...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Flow (Other open bugs)
master
All All
: Unprioritized major (vote)
: ---
Assigned To: Nobody - You can work on this!
ee-flow.wmflabs.org/w/index.php?title...
:
: 57161 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-13 07:22 UTC by spage
Modified: 2013-12-06 21:55 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description spage 2013-11-13 07:22:53 UTC
When you put a [[Pagename]] link in Flow, Parsoid generates a link of the form
 <a rel="mw:WikiLink" href="./Pagename" data-parsoid="{&qu blah blah ...

Note it's a relative link, not an absolute link.  This works if you are viewing /wiki/User_talk:SomeBoard , but if you view a permalink, or view a diff, or even just http://ee-flow.wmflabs.org/w/index.php?title=User_talk:Spage , the relative href to /w/index.php becomes a link to /w/Pagename, which is a 404.

This feels like a Parsoid problem, but it might be addressed by ErikB's comment in ParsoidUtils.php,

  // @todo needs a big refactor to get a page title in here, fake Main_Page for now

(Huge props to quiddity for noticing this one.)
Comment 1 spage 2013-11-13 07:42:46 UTC
The WMF core features team tracks this bug on Mingle card https://mingle.corp.wikimedia.org/projects/flow/cards/457, but people from the community are welcome to contribute here and in Gerrit.
Comment 2 spage 2013-11-13 10:43:47 UTC
On ee-flow labs instance, invoking Parsoid with
   $ curl localhost:8000/localhost/ -d wt='[[Pagename]] here'
produces

...
<base href="http://ee-flow.wmflabs.org/wiki/Main Page"/>
</head>
<body data-parsoid='{"dsr":[0,318,0,0]}'>
  <p data-parsoid='{"dsr":[0,318,0,0]}'>
    <a rel="mw:WikiLink" href="./Pagename" data-parsoid='{"stx":"simple","a":{"href":"./Pagename"},"sa":{"href":"Pagename"},"dsr":[0,313,2,2]}'>Pagename</a>
    here
  </p>
...

Note the base href, which will make the href have the right /wiki/ prefix regardless of the current URL.
But Flow's parsing of the HTML returned by Parsoid ignores the base href, and it doesn't set base href in its own HTML HEAD.  Flow could do this (assuming the base href will be the same for all items in the Flow board),
, or it could parse the HTML, or the the Parsoid API could have an option to generate full paths.

The HTML for [[Pagename]] on a regular wiki page is an absolute path -- href="/wiki/Pagename" , so Parsoid's behavior is different.

Note that some day a user's "My active threads" Flow board might show conversations from multiple wikis, so absolute URLs might be useful, some day.
Comment 3 Gerrit Notification Bot 2013-11-14 23:22:17 UTC
Change 95563 had a related patch set uploaded by EBernhardson:
Hackish method of respecting parsoid base href

https://gerrit.wikimedia.org/r/95563
Comment 4 spage 2013-11-18 19:48:44 UTC
*** Bug 57161 has been marked as a duplicate of this bug. ***
Comment 5 Gerrit Notification Bot 2013-11-19 01:55:16 UTC
Change 96189 had a related patch set uploaded by EBernhardson:
Workaround for relative links in /w/index.php

https://gerrit.wikimedia.org/r/96189
Comment 6 Gerrit Notification Bot 2013-11-19 01:56:29 UTC
Change 95563 abandoned by EBernhardson:
Hackish method of respecting parsoid base href

Reason:
Going a different direction for the temporary fix, https://gerrit.wikimedia.org/r/96189

https://gerrit.wikimedia.org/r/95563
Comment 7 Gerrit Notification Bot 2013-11-20 16:03:12 UTC
Change 96189 merged by jenkins-bot:
Workaround for relative links in /w/index.php

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links