From e7afe5b8edc2a3a3b28f0da47a6069c1350982f8 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 5 Mar 2008 13:50:17 +0000 Subject: [PATCH] (bug 13110) Don't show "Permission error" page but "Rollback failed" if the edit is allready rolled back when using rollback or the user is the only author of the page. Also show the 'editcomment' message (like before) with the last edit comment if the last author changed. --- RELEASE-NOTES | 2 ++ includes/Article.php | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b3dce7b4b7..1f00e25f88 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -66,6 +66,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 13019) Message cache for some extensions not loaded at time of editing * (bug 13247) Prettified ISBN links * maintenance/refreshLinks.php did not fix page_id 1 with the --new-only option +* (bug 13110) Don't show "Permission error" page if the edit is allready rolled + back when using rollback === API changes in 1.13 === diff --git a/includes/Article.php b/includes/Article.php index 75c44cc1e1..624c9762ba 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2436,6 +2436,19 @@ class Article { $wgOut->rateLimited(); return; } + if( isset( $result[0][0] ) && ( $result[0][0] == 'alreadyrolled' || $result[0][0] == 'cantrollback' ) ){ + $wgOut->setPageTitle( wfMsg( 'rollbackfailed' ) ); + $errArray = $result[0]; + $errMsg = array_shift( $errArray ); + $wgOut->addWikiMsgArray( $errMsg, $errArray ); + if( isset( $details['current'] ) ){ + $current = $details['current']; + if( $current->getComment() != '' ) { + $wgOut->addWikiMsgArray( 'editcomment', array( $wgUser->getSkin()->formatComment( $current->getComment() ) ), array( 'replaceafter' ) ); + } + } + return; + } # Display permissions errors before read-only message -- there's no # point in misleading the user into thinking the inability to rollback # is only temporary. -- 2.20.1