Last modified: 2014-10-20 19:19:55 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.
Also wgIsRedirect is false on the landing page. Should be true imo since I was redirected.
Ok, we have wgRedirectedFrom.
I'm using javascript to redirect now to fix this bug. This cannot be right!
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).
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.
Same result for $r .= $this->msg( 'myMessage', 'fooBar' )->parse(); I can pass the title in the message but that would be so 1999.