Last modified: 2011-01-25 00:47:20 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 T19183, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17183 - Make magic word {{CURRENTYEAR}} functional in redirects
Make magic word {{CURRENTYEAR}} functional in redirects
Status: RESOLVED DUPLICATE of bug 1575
Product: MediaWiki
Classification: Unclassified
Redirects (Other open bugs)
1.15.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-27 21:58 UTC by BT
Modified: 2011-01-25 00:47 UTC (History)
3 users (show)

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


Attachments

Description BT 2009-01-27 21:58:59 UTC
Currently, using {{CURRENTYEAR}} in a redirect breaks that redirect.  See http://en.wikipedia.org/w/index.php?title=Recent_celebrity_deaths&diff=next&oldid=266593298, where "#REDIRECT [[Deaths in {{CURRENTYEAR}}]]" does not work.  

Making this functional would save the hassle of having to remember to change these pages manually every year.
Comment 1 Chad H. 2009-01-28 00:40:08 UTC
If we're going to do this, we need to open all wikitext to redirects. Currently, we just do a quick regex to check if a page is a redirect, rather than fully parsing it prior to redirection.

Only implementing this for {{CURRENTYEAR}} would be a hack.
Comment 2 Chad H. 2009-07-28 11:05:52 UTC

*** This bug has been marked as a duplicate of bug 14323 ***
Comment 3 Brad Jorsch 2009-07-28 12:37:06 UTC
In what way is this a dup of bug 14323? This bug is about allowing magic words in the redirect target link, while 14323 is about rendering the wikitext that comes '''after''' the redirect magic. That's two completely different things; in particular, fixing bug 14323 would most certainly not fix this bug.
Comment 4 Chad H. 2009-07-28 13:06:15 UTC
Yes it would. As mentioned in the other bug, attempting to only allow some things to parse prior to redirect (like in this bug: {{currentyear}}) is half-assing it. If we're going to parse an article, then we need to parse it properly.
Comment 5 Brad Jorsch 2009-07-28 13:37:14 UTC
Perhaps you're unfamiliar with how the redirect code works?

To find the target of the redirect from the page wikitext, it just looks for "#REDIRECT [[...]]" in the raw text at the beginning (properly localized and such, of course). It never parses the wikitext at all. See newFromRedirectInternal() in Title.php.

When doing a redirect=no page view, it parses the wikitext of the page in order to get categories, template backlinks, interwiki links, and such. But at the moment, it just throws the output text of that parse away. Not throwing it away is bug 14323. See view() in Article.php, at lines 878-886 in r53792.

Stopping the throwing-away won't at all affect the function used to find the target, and changing how the target-finding function works won't stop throwing the parser output away.
Comment 6 Alexandre Emsenhuber [IAlex] 2009-08-24 17:05:17 UTC

*** This bug has been marked as a duplicate of bug 1575 ***

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


Navigation
Links