From e84868d256d50bccd8bf2419b21d8eb9a4c33342 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Fri, 31 Jul 2015 17:00:48 -0700 Subject: [PATCH] Revision::newNullRevision: Make sure the Title is set in the constructor Revision::__construct() calls Revision::getContentModel() to initialize the 'content_model' field. If a Title object is not set, it will try to look up the page in the slave database, which might be behind. At that point it will default to wikitext, which is problematic during imports. By passing the Title object in the constructor instead of afterwards, the content model should be intialized properly. Bug: T91170 Change-Id: I7fea996ea5b723967272af8cb344150aea10bb54 --- includes/Revision.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/Revision.php b/includes/Revision.php index 71bdf58cea..32ee259f3d 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -1641,8 +1641,9 @@ class Revision implements IDBAccessObject { $row['content_format'] = $current->rev_content_format; } + $row['title'] = Title::makeTitle( $current->page_namespace, $current->page_title ); + $revision = new Revision( $row ); - $revision->setTitle( Title::makeTitle( $current->page_namespace, $current->page_title ) ); } else { $revision = null; } -- 2.20.1