r51530 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51529‎ | r51530 | r51531 >
Date:03:32, 6 June 2009
Author:tstarling
Status:deferred
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialRevisiondelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php
@@ -38,9 +38,6 @@
3939 /** The RevDel_List object, storing the list of items to be deleted/undeleted */
4040 var $list;
4141
42 - /** New bitfield value, used for form display post-submit */
43 - var $newBits;
44 -
4542 /**
4643 * Assorted information about each type, needed by the special page.
4744 * TODO Move some of this to the list class
@@ -325,10 +322,6 @@
326323 $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
327324 return;
328325 }
329 -
330 - if ( !is_null( $this->newBits ) ) {
331 - $bitfields = $this->newBits;
332 - }
333326
334327 $wgOut->addHTML( "</ul>" );
335328 // Explanation text
@@ -422,6 +415,7 @@
423416 global $wgOut;
424417 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
425418 $wgOut->wrapWikiMsg( '<span class="success">$1</span>', $this->typeInfo['success'] );
 419+ $this->list->reloadFromMaster();
426420 $this->showForm();
427421 }
428422
@@ -459,7 +453,6 @@
460454 if( $bitfield == Revision::DELETED_RESTRICTED ) {
461455 return Status::newFatal( 'revdelete-only-restricted' );
462456 }
463 - $this->newBits = $bitfield;
464457 return $this->getList()->setVisibility( array(
465458 'value' => $bitfield,
466459 'comment' => $reason ) );
@@ -713,6 +706,15 @@
714707 }
715708
716709 /**
 710+ * Reload the list data from the master DB. This can be done after setVisibility()
 711+ * to allow $item->getHTML() to show the new data.
 712+ */
 713+ function reloadFromMaster() {
 714+ $dbw = wfGetDB( DB_MASTER );
 715+ $this->res = $this->doQuery( $dbw );
 716+ }
 717+
 718+ /**
717719 * Record a log entry on the action
718720 * @param $params Associative array of parameters:
719721 * newBits: The new value of the *_deleted bitfield

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r51279In Special:RevisionDelete:...tstarling11:37, 1 June 2009

Status & tagging log