From 903d18ed982e98436f3561b81cc8369a573ada40 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Tue, 31 Oct 2006 15:57:37 +0000 Subject: [PATCH] Fixed redirect table update per brion's suggestions. --- includes/Article.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 6bc38c56aa..d5b97c4bfe 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1008,8 +1008,6 @@ class Article { $text = $revision->getText(); $rt = Title::newFromRedirect( $text ); - $this->updateRedirectOn( $dbw, $rt, $lastRevIsRedirect ); - $conditions = array( 'page_id' => $this->getId() ); if( !is_null( $lastRevision ) ) { # An extra check against threads stepping on each other @@ -1027,8 +1025,15 @@ class Article { $conditions, __METHOD__ ); + $result = $dbw->affectedRows() != 0; + + if ($result) { + // FIXME: Should the result from updateRedirectOn() be returned instead? + $this->updateRedirectOn( $dbw, $rt, $lastRevIsRedirect ); + } + wfProfileOut( __METHOD__ ); - return ( $dbw->affectedRows() != 0 ); + return $result; } /** @@ -1104,7 +1109,7 @@ class Article { return false; } $prev = $row->rev_id; - $lastRevIsRedirect = $row->page_is_redirect === '1'; + $lastRevIsRedirect = (bool)$row->page_is_redirect; } else { # No or missing previous revision; mark the page as new $prev = 0; -- 2.20.1