From d4337ba10e81b75d20cdf14e11e50f6e79526e81 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 29 Jul 2011 16:44:22 +0000 Subject: [PATCH] * Follow-up r93093: set the touch key for page moves too * Tweaked related WikiPage.php comments --- includes/Title.php | 5 ++++- includes/WikiPage.php | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index a774404f28..3eae96048a 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3232,6 +3232,7 @@ class Title { if ( $u ) { $u->doUpdate(); } + # Update message cache for interface messages if ( $this->getNamespace() == NS_MEDIAWIKI ) { # @bug 17860: old article can be deleted, if this the case, @@ -3324,10 +3325,11 @@ class Title { } $nullRevId = $nullRevision->insertOn( $dbw ); + $now = wfTimestampNow(); # Change the name of the target page: $dbw->update( 'page', /* SET */ array( - 'page_touched' => $dbw->timestamp(), + 'page_touched' => $dbw->timestamp( $now ), 'page_namespace' => $nt->getNamespace(), 'page_title' => $nt->getDBkey(), 'page_latest' => $nullRevId, @@ -3339,6 +3341,7 @@ class Title { $article = new Article( $nt ); wfRunHooks( 'NewRevisionFromEditComplete', array( $article, $nullRevision, $latest, $wgUser ) ); + $article->setCachedLastEditTime( $now ); # Recreate the redirect, this time in the other direction. if ( $createRedirect || !$wgUser->isAllowed( 'suppressredirect' ) ) { diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 9c8eaea0f3..19ac74bf1e 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -846,7 +846,8 @@ class WikiPage extends Page { } /** - * Get the cached timestamp for the last time the page changed + * Get the cached timestamp for the last time the page changed. + * This is only used to help handle slave lag by comparing to page_touched. * @return string MW timestamp */ protected function getCachedLastEditTime() { @@ -856,7 +857,8 @@ class WikiPage extends Page { } /** - * Set the cached timestamp for the last time the page changed + * Set the cached timestamp for the last time the page changed. + * This is only used to help handle slave lag by comparing to page_touched. * @param $timestamp string * @return void */ -- 2.20.1