From: Yuri Astrakhan Date: Tue, 31 Oct 2006 15:57:37 +0000 (+0000) Subject: Fixed redirect table update per brion's suggestions. X-Git-Tag: 1.31.0-rc.0~55337 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=903d18ed982e98436f3561b81cc8369a573ada40;p=lhc%2Fweb%2Fwiklou.git Fixed redirect table update per brion's suggestions. --- 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;