Merge "Don't check namespace in SpecialWantedtemplates"
[lhc/web/wiklou.git] / includes / revisiondelete / RevDelList.php
index f16fd15..7aac3b8 100644 (file)
@@ -78,7 +78,7 @@ abstract class RevDelList extends RevisionListBase {
         * transactions are done here.
         *
         * @param array $params Associative array of parameters. Members are:
-        *     value:         The integer value to set the visibility to
+        *     value:         ExtractBitParams() bitfield array
         *     comment:       The log comment.
         *     perItemStatus: Set if you want per-item status reports
         * @return Status
@@ -89,10 +89,13 @@ abstract class RevDelList extends RevisionListBase {
                $comment = $params['comment'];
                $perItemStatus = isset( $params['perItemStatus'] ) ? $params['perItemStatus'] : false;
 
-               $this->res = false;
+               // CAS-style checks are done on the _deleted fields so the select
+               // does not need to use FOR UPDATE nor be in the atomic section
                $dbw = wfGetDB( DB_MASTER );
-               $this->doQuery( $dbw );
+               $this->res = $this->doQuery( $dbw );
+
                $dbw->startAtomic( __METHOD__ );
+
                $status = Status::newGood();
                $missing = array_flip( $this->ids );
                $this->clearFileOps();
@@ -106,6 +109,7 @@ abstract class RevDelList extends RevisionListBase {
                // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
                for ( $this->reset(); $this->current(); $this->next() ) {
                        // @codingStandardsIgnoreEnd
+                       /** @var $item RevDelItem */
                        $item = $this->current();
                        unset( $missing[$item->getId()] );
 
@@ -197,6 +201,7 @@ abstract class RevDelList extends RevisionListBase {
                }
 
                // Log it
+               // @FIXME: $newBits/$oldBits set in for loop, makes IDE warnings too
                $this->updateLog( array(
                        'title' => $this->title,
                        'count' => $successCount,
@@ -246,7 +251,7 @@ abstract class RevDelList extends RevisionListBase {
                if ( !$field ) {
                        throw new MWException( "Bad log URL param type!" );
                }
-               // Put things hidden from sysops in the oversight log
+               // Put things hidden from sysops in the suppression log
                if ( ( $params['newBits'] | $params['oldBits'] ) & $this->getSuppressBit() ) {
                        $logType = 'suppress';
                } else {