Last modified: 2014-10-20 19:19:55 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 T74230, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 72230 - Magic words broken after redirect in template called by wfMessage
Magic words broken after redirect in template called by wfMessage
Status: NEW
Product: MediaWiki
Classification: Unclassified
Redirects (Other open bugs)
1.22.12
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-19 12:03 UTC by Subfader
Modified: 2014-10-20 19:19 UTC (History)
1 user (show)

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


Attachments

Description Subfader 2014-10-19 12:03:03 UTC
In a skin or on Category page I use wfMessage to call a template to add content.

In the template I use {{PAGENAME}}.

If the page is redirected, {{PAGENAME}} returns the wrong redirecting title.

This worked in MW 1.16 and is now broken in MW 1.22.
Comment 1 Subfader 2014-10-19 12:21:06 UTC
Also wgIsRedirect is false on the landing page. Should be true imo since I was redirected.
Comment 2 Subfader 2014-10-19 12:21:37 UTC
Ok, we have wgRedirectedFrom.
Comment 3 Subfader 2014-10-19 13:02:37 UTC
I'm using javascript to redirect now to fix this bug.

This cannot be right!
Comment 4 Bawolff (Brian Wolff) 2014-10-19 19:39:02 UTC
Can you give us some example code that demonstrates the issue (Or concrete steps to reproduce)?

What title wfMessage() considers the current page to be can vary depending on at what time in execution it is called (Evil hidden global magic), so it helps to know at what point the function is being called. (Also, if you have an instance of IContextSource handy, calling the ->msg() method is more likely to get the right title, than a generic call to wfMessage, although ideally either would work).
Comment 5 Subfader 2014-10-20 19:15:39 UTC
CategoryViewer.php > function getCategoryTop() > somewhere add
  $r .= wfMessage( 'myMessage', 'fooBar' )->parse();

MediaWiki:MyMessage > add
  {{MyMessageTemplate}}

Template:MyMessageTemplate > add
  {{PAGENAME}}

Create a redirect category. Call the redirecting category > After the redirect the head reads the wrong page name.
Comment 6 Subfader 2014-10-20 19:19:55 UTC
Same result for $r .= $this->msg( 'myMessage', 'fooBar' )->parse();

I can pass the title in the message but that would be so 1999.

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


Navigation
Links