r23513 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23512‎ | r23513 | r23514 >
Date:18:12, 28 June 2007
Author:robchurch
Status:old
Tags:
Comment:
Sort out this ridiculous bug in Special:MovePage success message once and for all. Ditch the old message ("pagemovedtext") and introduce a new one ("movepage-moved") which expects proper links, parsed inline. Link to original page doesn't redirect.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialMovepage.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -1373,7 +1373,7 @@
13741374 'move-watch',
13751375 'movepagebtn',
13761376 'pagemovedsub',
1377 - 'pagemovedtext',
 1377+ 'movepage-moved',
13781378 'articleexists',
13791379 'talkexists',
13801380 'movedto',
Index: trunk/phase3/includes/SpecialMovepage.php
@@ -266,24 +266,26 @@
267267 }
268268
269269 function showSuccess() {
270 - global $wgOut, $wgRequest, $wgRawHtml;
 270+ global $wgOut, $wgRequest, $wgUser, $wgRawHtml;
271271
272272 $wgOut->setPagetitle( wfMsg( 'movepage' ) );
273273 $wgOut->setSubtitle( wfMsg( 'pagemovedsub' ) );
274274
275 - $oldText = wfEscapeWikiText( $wgRequest->getVal('oldtitle') );
276 - $newText = wfEscapeWikiText( $wgRequest->getVal('newtitle') );
277 - $talkmoved = $wgRequest->getVal('talkmoved');
 275+ $old = Title::newFromText( $wgRequest->getText( 'oldtitle' ) );
 276+ $new = Title::newFromText( $wgRequest->getText( 'newtitle' ) );
 277+ $talkmoved = $wgRequest->getVal( 'talkmoved' );
 278+
 279+ $olink = $wgUser->getSkin()->makeKnownLinkObj( $old, '', 'redirect=no' );
 280+ $nlink = $wgUser->getSkin()->makeKnownLinkObj( $new );
278281
279 - $wgOut->addHtml( wfMsgExt( 'pagemovedtext', array( 'parse' ), $oldText, $newText ) );
 282+ $wgOut->addHtml( wfMsgExt( 'movepage-moved', array( 'parseinline', 'replaceafter' ), $olink, $nlink ) );
280283
281284 if ( $talkmoved == 1 ) {
282285 $wgOut->addWikiText( wfMsg( 'talkpagemoved' ) );
283286 } elseif( 'articleexists' == $talkmoved ) {
284287 $wgOut->addWikiText( wfMsg( 'talkexists' ) );
285288 } else {
286 - $oldTitle = Title::newFromText( $oldText );
287 - if ( isset( $oldTitle ) && !$oldTitle->isTalkPage() && $talkmoved != 'notalkpage' ) {
 289+ if( !$old->isTalkPage() && $talkmoved != 'notalkpage' ) {
288290 $wgOut->addWikiText( wfMsg( 'talkpagenotmoved', wfMsg( $talkmoved ) ) );
289291 }
290292 }
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2098,7 +2098,7 @@
20992099 'move-watch' => 'Watch this page',
21002100 'movepagebtn' => 'Move page',
21012101 'pagemovedsub' => 'Move succeeded',
2102 -'pagemovedtext' => 'Page "[[$1]]" moved to "[[$2]]".',
 2102+'movepage-moved' => "<big>'''\"$1\" has been moved to \"$2\"'''</big>",
21032103 'articleexists' => 'A page of that name already exists, or the
21042104 name you have chosen is not valid.
21052105 Please choose another name.',
Index: trunk/phase3/RELEASE-NOTES
@@ -231,8 +231,8 @@
232232 security settings are cranked this way and AJAX-y gets used.
233233 * Delay AJAX watch initialization until click so IE 6 with ugly security
234234 settings doesn't prompt you until you use the link.
 235+* (bug 10399) Provide non-redirecting link to original title in Special:Movepage
235236
236 -
237237 == API changes since 1.10 ==
238238
239239 (For ongoing development discussion, see http://www.mediawiki.org/wiki/API)

Follow-up revisions

RevisionCommit summaryAuthorDate
r23516Update Farsi for r23513, patch from Hujirobchurch18:54, 28 June 2007
r23581Merged revisions 23406-23580 via svnmerge from...david04:50, 30 June 2007

Status & tagging log