r47320 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47319‎ | r47320 | r47321 >
Date:16:54, 16 February 2009
Author:simetrical
Status:resolved (Comments)
Tags:
Comment:
Partial revert of r41018 "Wrap $log->addEntry() in transaction"

Backporting r47318 to branch.
Modified paths:
  • /branches/REL1_14/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: branches/REL1_14/phase3/includes/Article.php
@@ -2473,6 +2473,14 @@
24742474 $dbw->delete( 'langlinks', array( 'll_from' => $id ) );
24752475 $dbw->delete( 'redirect', array( 'rd_from' => $id ) );
24762476 }
 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 );
24772485
24782486 # If using cleanup triggers, we can skip some manual deletes
24792487 if( !$dbw->cleanupTriggers() ) {
@@ -2489,14 +2497,6 @@
24902498
24912499 # Clear caches
24922500 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 );
25012501
25022502 # Clear the cached article id so the interface doesn't act like we exist
25032503 $this->mTitle->resetArticleID( 0 );
@@ -2508,7 +2508,7 @@
25092509
25102510 # Make sure logging got through
25112511 $log->addEntry( 'delete', $this->mTitle, $reason, array() );
2512 -
 2512+
25132513 $dbw->commit();
25142514
25152515 return true;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r41018Wrap $log->addEntry() in transactionaaron23:43, 18 September 2008
r47318Newline after help message to not mess up terminalsimetrical15:35, 16 February 2009

Comments

#Comment by Simetrical (talk | contribs)   16:59, 16 February 2009

"Backporting r47318 to branch."

I meant r47319.

#Comment by Aaron Schulz (talk | contribs)   22:32, 17 February 2009

Tweaked in r47328

Status & tagging log