Fix for CR r51279: reload data from master post-submit so that the list is shown...
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 6 Jun 2009 03:32:20 +0000 (03:32 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 6 Jun 2009 03:32:20 +0000 (03:32 +0000)
includes/specials/SpecialRevisiondelete.php

index 7166311..1ab9d99 100644 (file)
@@ -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( "</ul>" );
                // Explanation text
@@ -422,6 +415,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                global $wgOut;
                $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
                $wgOut->wrapWikiMsg( '<span class="success">$1</span>', $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: