From d04ddbaf9fbe7cb7cfc6c6e9aa9d8a1e940128c8 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 12 Sep 2008 15:03:46 +0000 Subject: [PATCH] Tweak transaction for bug 13039 --- includes/Article.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.20.1