Use master when fetching revision to base a null-revison on.
authordaniel <daniel.kinzler@wikimedia.de>
Tue, 10 Jul 2018 17:54:11 +0000 (19:54 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Tue, 10 Jul 2018 17:54:11 +0000 (19:54 +0200)
Bug: T198869
Change-Id: I7396246581deabc2cb7206b3e5d2a6f97f6d7418

includes/Storage/RevisionStore.php

index 12bee1e..76cf3f9 100644 (file)
@@ -896,8 +896,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.