Last modified: 2014-07-31 08:58:26 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 T37858, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35858 - Migrate legacy redirectToFragment to modern structure
Migrate legacy redirectToFragment to modern structure
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Redirects (Other open bugs)
1.18.x
All All
: Normal normal (vote)
: 1.22.x release
Assigned To: Umherirrender
: easy
Depends on:
Blocks: 33836 54245
  Show dependency treegraph
 
Reported: 2012-04-10 16:27 UTC by P.Copp
Modified: 2014-07-31 08:58 UTC (History)
8 users (show)

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


Attachments

Description P.Copp 2012-04-10 16:27:17 UTC
If a redirect points to a page with an anchor, an inline script is added to the page, which calls redirectToFragment() from wikibits.js.

As there is now the possibility to turn off loading of wikibits.js via $wgIncludeLegacyJavaScript, the inline script should be replaced with something more modern.

Possible fix: Add a mw.config variable like wgRedirectFragment to the page and put the functionality of redirectToFragment() into mediawiki.page.startup.
Comment 1 Jon 2013-09-17 22:03:55 UTC
This also breaks on mobile where legacy code is not loaded.
Comment 2 Krinkle 2013-09-18 03:23:54 UTC
(In reply to comment #0)
> Possible fix: Add a mw.config variable like wgRedirectFragment to the page
> and put the functionality of redirectToFragment() into mediawiki.page.startup.

Sounds good, though maybe in mediawiki.page.ready or mediawiki.util instead.

Things we can clean up:
* Expose fragment target through mw.config (instead of direct invocation by extra inserted <script> element)
* Avoid creating extra history entries (probably by using location.replace instead of location.hash = '').
* Move interface from legacy.wikibits to mediawiki.util or mediawiki.page.ready (either way exposed as a public method as it seems generally useful to be able to call from code, especially considering the prep work in mw.hook that encourages this model where we don't make things exclusively available for the default page load).
Comment 3 Andre Klapper 2013-09-26 15:08:53 UTC
As the Target Milestone on this ticket has been set to 1.22.0:

According to http://lists.wikimedia.org/pipermail/wikitech-l/2013-September/072030.html "MediaWiki 1.22 is slated for release on November 30th, at the very latest."

If this is still intended to get fixed for 1.22.0, a patch is needed soon.
Comment 4 Gerrit Notification Bot 2013-11-08 20:14:01 UTC
Change 94412 had a related patch set uploaded by Umherirrender:
migrate redirectToFragment() from wikibits.js to own module

https://gerrit.wikimedia.org/r/94412
Comment 5 Andre Klapper 2013-12-07 02:37:53 UTC
[Bumping TM as MediaWiki 1.22.0 tarball was released today.]
Comment 6 Gerrit Notification Bot 2014-01-07 21:16:17 UTC
Change 94412 merged by jenkins-bot:
Migrate redirectToFragment() from wikibits.js to own module

https://gerrit.wikimedia.org/r/94412
Comment 7 Gerrit Notification Bot 2014-05-08 10:28:56 UTC
Change 132181 had a related patch set uploaded by MarkAHershberger:
Migrate redirectToFragment() from wikibits.js to own module

https://gerrit.wikimedia.org/r/132181
Comment 8 Mark A. Hershberger 2014-05-09 07:41:42 UTC
cherry pick failed, but if someone wants to take this on, we could merge it.
Comment 9 Andre Klapper 2014-05-09 11:57:32 UTC
Current patch is -2 due to Jenkins bot; reclosing as FIXED (for 1.23/master).
Comment 10 Gerrit Notification Bot 2014-05-10 23:12:55 UTC
Change 132181 abandoned by Bartosz Dziewoński:
Migrate redirectToFragment() from wikibits.js to own module

Reason:
I'm going to declare that this is not a critical bugfix and thus is not worth the hassle to backport.

https://gerrit.wikimedia.org/r/132181
Comment 11 db [inactive,noenotif] 2014-07-31 08:58:26 UTC
Remove backport flag due to abandon reason.

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


Navigation
Links