Last modified: 2011-11-30 12:44:05 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 32230 - Provide a JavaScript variable for the "redirected from" page title
Provide a JavaScript variable for the "redirected from" page title
Product: MediaWiki
Classification: Unclassified
Redirects (Other open bugs)
All All
: Unprioritized enhancement (vote)
: 1.19.0 release
Assigned To: Nobody - You can work on this!
: easy, patch, patch-need-review
: 11040 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2011-11-06 18:59 UTC by Bergi
Modified: 2011-11-30 12:44 UTC (History)
6 users (show)

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

patch against trunk (1.89 KB, patch)
2011-11-28 00:41 UTC, MrBlueSky
Patch against trunk (1.89 KB, patch)
2011-11-28 14:55 UTC, MrBlueSky

Description Bergi 2011-11-06 18:59:27 UTC
This would make live (and coding) very much easier. When you got redirected, the only evidence for that is the html content of the contentSub element. Very ugly to detect by js in different skins and languages.

Another possibility would be to give the <a> element in the contentSub an id, but I think the first approach is cleaner.

Example where that could be needed? To hide Template:Redirect (and its interwiki equivalents) when you got *not* redirected.
Comment 1 Sumana Harihareswara 2011-11-07 04:15:17 UTC
Thanks for the request, Bergi.  I'm removing the 1.18 tarball release milestone because I think this is not *urgent* enough for us to aim to fix it, review the code for the fix, and roll it out within the next couple of weeks (which is when we're trying to get the 1.18 tarball release out).  However, per discussion with Daniel Friesen on IRC, it seems reasonable to aim for the 1.19 tarball release, so I've added that milestone instead.
Comment 2 Fomafix 2011-11-13 11:43:23 UTC
$wgMaxRedirects allows to follow more than one redirects. A new JavaScript variable should contain an array of the redirected titles. The Array should be empty when there is no redirect.
Comment 3 MrBlueSky 2011-11-25 01:03:40 UTC
If $wgMaxRedirects is set to a value > 1 still only one redirect is actually followed. The rest of the redirect chain (up to $wgMaxRedirects redirects) is shown to the visitor, but not followed.
Comment 4 MrBlueSky 2011-11-28 00:41:07 UTC
Created attachment 9567 [details]
patch against trunk

Puts the "redirected from" pagetitle in mw.config.get('wgRedirectedFrom').

Usage example: 
if ('wgRedirectedFrom')) {
Comment 5 MrBlueSky 2011-11-28 14:55:39 UTC
Created attachment 9570 [details]
Patch against trunk

Using getPrefixedDBKey() instead of getPrefixedText().
Comment 6 Roan Kattouw 2011-11-30 12:36:57 UTC
I swear there's another bug for this where I updated someone else's patch, but MrBlueSky's patch on this bug is better.
Comment 7 Roan Kattouw 2011-11-30 12:38:47 UTC
*** Bug 11040 has been marked as a duplicate of this bug. ***
Comment 8 Roan Kattouw 2011-11-30 12:44:05 UTC
Patch committed in r104668.

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