From 00104e2c0eeb7e713d0945d5b33893dac6e0d250 Mon Sep 17 00:00:00 2001 From: GeoffreyT2000 Date: Wed, 8 May 2019 17:56:15 -0700 Subject: [PATCH] Remove title protection correctly for undeletions and imports Undeletions and imports can both produce "new" pages with more than 1 revision. The fact that $options['created'] for the associated DerivedPageDataUpdater instance is unexpectedly changed to false is due to the fact that the latest revision often has a nonzero rev_parent_id. This causes WikiPage::onArticleCreate not to be applied correctly, and so title protection is not correctly removed. The part about "created" being forced is therefore being fixed. Bug: T200088 Change-Id: I8c899893486976285eb6fac87d641e93a616676d --- includes/Storage/DerivedPageDataUpdater.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/Storage/DerivedPageDataUpdater.php b/includes/Storage/DerivedPageDataUpdater.php index 68814ef3aa..f49ea60a28 100644 --- a/includes/Storage/DerivedPageDataUpdater.php +++ b/includes/Storage/DerivedPageDataUpdater.php @@ -1208,7 +1208,8 @@ class DerivedPageDataUpdater implements IDBAccessObject, LoggerAwareInterface { } // "created" is forced here - $this->options['created'] = ( $this->pageState['oldId'] === 0 ); + $this->options['created'] = ( $this->options['created'] || + ( $this->pageState['oldId'] === 0 ) ); $this->revision = $revision; -- 2.20.1