MergeHistory: Duplicate watchers on history merge
authorFomafix <fomafix@googlemail.com>
Mon, 11 Apr 2016 10:41:39 +0000 (12:41 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Sat, 16 Dec 2017 00:02:43 +0000 (00:02 +0000)
Bug: T132130
Change-Id: Ibb2be4f6f975f8f3c542689530fc120f8a464914

includes/MergeHistory.php

index 9d63869..b969e03 100644 (file)
@@ -24,6 +24,7 @@
  *
  * @file
  */
+use MediaWiki\MediaWikiServices;
 use Wikimedia\Timestamp\TimestampException;
 use Wikimedia\Rdbms\IDatabase;
 
@@ -335,6 +336,10 @@ class MergeHistory {
                }
                $this->dest->invalidateCache(); // update histories
 
+               // Duplicate watchers of the old article to the new article on history merge
+               $store = MediaWikiServices::getInstance()->getWatchedItemStore();
+               $store->duplicateAllAssociatedEntries( $this->source, $this->dest );
+
                // Update our logs
                $logEntry = new ManualLogEntry( 'merge', 'merge' );
                $logEntry->setPerformer( $user );