Fix r47319: this is reverting the wrong revision (cause was r40912). Move cat stuff...
authorAaron Schulz <aaron@users.mediawiki.org>
Mon, 16 Feb 2009 17:57:38 +0000 (17:57 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Mon, 16 Feb 2009 17:57:38 +0000 (17:57 +0000)
includes/Article.php

index 0ac7481..e3c5706 100644 (file)
@@ -2532,6 +2532,14 @@ class Article {
                        $dbw->rollback();
                        return false;
                }
+               
+               # Fix category table counts
+               $cats = array();
+               $res = $dbw->select( 'categorylinks', 'cl_to', array( 'cl_from' => $id ), __METHOD__ );
+               foreach( $res as $row ) {
+                       $cats []= $row->cl_to;
+               }
+               $this->updateCategoryCounts( array(), $cats );
 
                # If using cascading deletes, we can skip some explicit deletes
                if( !$dbw->cascadingDeletes() ) {
@@ -2549,14 +2557,6 @@ class Article {
                        $dbw->delete( 'langlinks', array( 'll_from' => $id ) );
                        $dbw->delete( 'redirect', array( 'rd_from' => $id ) );
                }
-               
-               # Fix category table counts
-               $cats = array();
-               $res = $dbw->select( 'categorylinks', 'cl_to', array( 'cl_from' => $id ), __METHOD__ );
-               foreach( $res as $row ) {
-                       $cats []= $row->cl_to;
-               }
-               $this->updateCategoryCounts( array(), $cats );
 
                # If using cleanup triggers, we can skip some manual deletes
                if( !$dbw->cleanupTriggers() ) {