From 161e2d194a394878b5a9408af394aecdcf6d1fe7 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 6 Jun 2009 03:32:20 +0000 Subject: [PATCH] Fix for CR r51279: reload data from master post-submit so that the list is shown with the new data. The newBits way of doing it was looking fragile. --- includes/specials/SpecialRevisiondelete.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index 716631112a..1ab9d99f87 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -38,9 +38,6 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { /** The RevDel_List object, storing the list of items to be deleted/undeleted */ var $list; - /** New bitfield value, used for form display post-submit */ - var $newBits; - /** * Assorted information about each type, needed by the special page. * TODO Move some of this to the list class @@ -325,10 +322,6 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' ); return; } - - if ( !is_null( $this->newBits ) ) { - $bitfields = $this->newBits; - } $wgOut->addHTML( "" ); // Explanation text @@ -422,6 +415,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { global $wgOut; $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) ); $wgOut->wrapWikiMsg( '$1', $this->typeInfo['success'] ); + $this->list->reloadFromMaster(); $this->showForm(); } @@ -459,7 +453,6 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { if( $bitfield == Revision::DELETED_RESTRICTED ) { return Status::newFatal( 'revdelete-only-restricted' ); } - $this->newBits = $bitfield; return $this->getList()->setVisibility( array( 'value' => $bitfield, 'comment' => $reason ) ); @@ -712,6 +705,15 @@ abstract class RevDel_List { return $status; } + /** + * Reload the list data from the master DB. This can be done after setVisibility() + * to allow $item->getHTML() to show the new data. + */ + function reloadFromMaster() { + $dbw = wfGetDB( DB_MASTER ); + $this->res = $this->doQuery( $dbw ); + } + /** * Record a log entry on the action * @param $params Associative array of parameters: -- 2.20.1