* Follow-up r93093: set the touch key for page moves too
authorAaron Schulz <aaron@users.mediawiki.org>
Fri, 29 Jul 2011 16:44:22 +0000 (16:44 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Fri, 29 Jul 2011 16:44:22 +0000 (16:44 +0000)
* Tweaked related WikiPage.php comments

includes/Title.php
includes/WikiPage.php

index a774404..3eae960 100644 (file)
@@ -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' ) ) {
index 9c8eaea..19ac74b 100644 (file)
@@ -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
         */