RevisionStore::newNullRevision must be passed a Title object when
being used, passing null will result in a fatal.
Title::newFromID can return null, so check and return null early if we
have no Title object.
Also use Title::GAID_FOR_UPDATE for a higher chance of getting a Title.
Prior to the Revision overhaul newNullRevision would have always done a
select from master, it is documented as accepting $dbw and also passed
FOR UPDATE as an option to selectRow.
Bug: T184687
Change-Id: If1f99d091ab9cd37d514a4f4cbf3c28b64426cb7
$comment = CommentStoreComment::newUnsavedComment( $summary, null );
- $title = Title::newFromID( $pageId );
+ $title = Title::newFromID( $pageId, Title::GAID_FOR_UPDATE );
+ if ( $title === null ) {
+ return null;
+ }
+
$rec = self::getRevisionStore()->newNullRevision( $dbw, $title, $comment, $minor, $user );
return new Revision( $rec );