From cafdbbc5cae95fe3778ada046049bbd783e72666 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 14 Jan 2007 12:03:56 +0000 Subject: [PATCH] * (bug 8632) Fix regression in page protection null edit update r19095 removed the code that updated the page record's cache timestamp and revision number, leaving the wrong page_latest reference. Putting it back, merging in the other query to clean out the old page_restrictions field. --- RELEASE-NOTES | 1 + includes/Article.php | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cd55c09b72..d089ae74b6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -65,6 +65,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Unmaintained Oracle support files have been removed. * Made Linker::userToolLinks() show the contribs link red when the user has zero edits * Use browser default for printing size, don't force to 11pt +* (bug 8632) Fix regression in page protection null edit update == Languages updated == diff --git a/includes/Article.php b/includes/Article.php index ed7746d3ea..ab6ad0a4c3 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1673,7 +1673,7 @@ class Article { if( $protect ) $comment .= " [$updated]"; $nullRevision = Revision::newNullRevision( $dbw, $id, $comment, true ); - $nullRevision->insertOn( $dbw ); + $nullRevId = $nullRevision->insertOn( $dbw ); # Update restrictions table foreach( $limit as $action => $restrictions ) { @@ -1687,11 +1687,16 @@ class Article { } } - # Blank page_restrictions on page record if they're being used. - if ($this->mTitle->mOldRestrictions) { - $dbw->update( 'page', array ( 'page_restrictions' => '' ), array ( 'page_id' => $id ), __METHOD__ ); - } - + # Update page record + $dbw->update( 'page', + array( /* SET */ + 'page_touched' => $dbw->timestamp(), + 'page_restrictions' => '', + 'page_latest' => $nullRevId + ), array( /* WHERE */ + 'page_id' => $id + ), 'Article::protect' + ); wfRunHooks( 'ArticleProtectComplete', array( &$this, &$wgUser, $limit, $reason ) ); # Update the protection log -- 2.20.1