From: Aaron Schulz Date: Fri, 12 Sep 2008 15:03:46 +0000 (+0000) Subject: Tweak transaction for bug 13039 X-Git-Tag: 1.31.0-rc.0~45351 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=d04ddbaf9fbe7cb7cfc6c6e9aa9d8a1e940128c8;p=lhc%2Fweb%2Fwiklou.git Tweak transaction for bug 13039 --- diff --git a/includes/Article.php b/includes/Article.php index 81853f3d3f..1735c9e1d7 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1466,8 +1466,9 @@ class Article { $lastRevision = 0; $revisionId = 0; - $changed = ( strcmp( $text, $oldtext ) != 0 ); + $dbw->begin(); + $changed = ( strcmp( $text, $oldtext ) != 0 ); if ( $changed ) { $this->mGoodAdjustment = (int)$this->isCountable( $text ) - (int)$this->isCountable( $oldtext ); @@ -1493,7 +1494,6 @@ class Article { 'user_text' => $user->getName(), ) ); - $dbw->begin(); $revisionId = $revision->insertOn( $dbw ); # Update page @@ -1519,7 +1519,6 @@ class Article { } } $user->incEditCount(); - $dbw->commit(); } } else { $revision = null; @@ -1541,6 +1540,7 @@ class Article { # Update links tables, site stats, etc. $this->editUpdates( $text, $summary, $isminor, $now, $revisionId, $changed ); + $dbw->commit(); } } else { # Create new article