Merge "Use master when fetching revision to base a null-revison on."
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 10 Jul 2018 18:37:26 +0000 (18:37 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 10 Jul 2018 18:37:26 +0000 (18:37 +0000)
includes/Storage/RevisionStore.php

index b01bdd8..390cc19 100644 (file)
@@ -948,8 +948,13 @@ class RevisionStore
                        return null;
                }
 
-               // Fetch the actual revision row, without locking all extra tables.
-               $oldRevision = $this->loadRevisionFromId( $dbw, $pageLatest );
+               // Fetch the actual revision row from master, without locking all extra tables.
+               $oldRevision = $this->loadRevisionFromConds(
+                       $dbw,
+                       [ 'rev_id' => intval( $pageLatest ) ],
+                       self::READ_LATEST,
+                       $title
+               );
 
                // Construct the new revision
                $timestamp = wfTimestampNow(); // TODO: use a callback, so we can override it for testing.