Add check for page existence
[lhc/web/wiklou.git] / maintenance / recountCategories.php
index ed6a357..838405a 100644 (file)
@@ -98,7 +98,7 @@ TEXT
 
        protected function doWork() {
                $this->output( "Finding up to {$this->getBatchSize()} drifted rows " .
-                       "starting at cat_id {$this->getBatchSize()}...\n" );
+                       "greater than cat_id {$this->minimumId}...\n" );
 
                $countingConds = [ 'cl_to = cat_title' ];
                if ( $this->mode === 'subcats' ) {
@@ -156,7 +156,7 @@ TEXT
                                [ "cat_{$this->mode}" => $row->count ],
                                [
                                        'cat_id' => $row->cat_id,
-                                       "cat_{$this->mode} != {$row->count}",
+                                       "cat_{$this->mode} != " . (int)( $row->count ),
                                ],
                                __METHOD__ );
                        $affectedRows += $dbw->affectedRows();
@@ -168,5 +168,5 @@ TEXT
        }
 }
 
-$maintClass = 'RecountCategories';
+$maintClass = RecountCategories::class;
 require_once RUN_MAINTENANCE_IF_MAIN;