Index: branches/REL1_14/phase3/includes/Article.php |
— | — | @@ -2473,6 +2473,14 @@ |
2474 | 2474 | $dbw->delete( 'langlinks', array( 'll_from' => $id ) ); |
2475 | 2475 | $dbw->delete( 'redirect', array( 'rd_from' => $id ) ); |
2476 | 2476 | } |
| 2477 | + |
| 2478 | + # Fix category table counts |
| 2479 | + $cats = array(); |
| 2480 | + $res = $dbw->select( 'categorylinks', 'cl_to', array( 'cl_from' => $id ), __METHOD__ ); |
| 2481 | + foreach( $res as $row ) { |
| 2482 | + $cats []= $row->cl_to; |
| 2483 | + } |
| 2484 | + $this->updateCategoryCounts( array(), $cats ); |
2477 | 2485 | |
2478 | 2486 | # If using cleanup triggers, we can skip some manual deletes |
2479 | 2487 | if( !$dbw->cleanupTriggers() ) { |
— | — | @@ -2489,14 +2497,6 @@ |
2490 | 2498 | |
2491 | 2499 | # Clear caches |
2492 | 2500 | Article::onArticleDelete( $this->mTitle ); |
2493 | | - |
2494 | | - # Fix category table counts |
2495 | | - $cats = array(); |
2496 | | - $res = $dbw->select( 'categorylinks', 'cl_to', array( 'cl_from' => $id ), __METHOD__ ); |
2497 | | - foreach( $res as $row ) { |
2498 | | - $cats []= $row->cl_to; |
2499 | | - } |
2500 | | - $this->updateCategoryCounts( array(), $cats ); |
2501 | 2501 | |
2502 | 2502 | # Clear the cached article id so the interface doesn't act like we exist |
2503 | 2503 | $this->mTitle->resetArticleID( 0 ); |
— | — | @@ -2508,7 +2508,7 @@ |
2509 | 2509 | |
2510 | 2510 | # Make sure logging got through |
2511 | 2511 | $log->addEntry( 'delete', $this->mTitle, $reason, array() ); |
2512 | | - |
| 2512 | + |
2513 | 2513 | $dbw->commit(); |
2514 | 2514 | |
2515 | 2515 | return true; |