Merge "watcheditem: Do not create the same TitleValue object twice"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 10 Jun 2019 20:27:02 +0000 (20:27 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 10 Jun 2019 20:27:02 +0000 (20:27 +0000)
1  2 
includes/watcheditem/WatchedItemStore.php

@@@ -641,7 -641,7 +641,7 @@@ class WatchedItemStore implements Watch
                        // @todo: Should we add these to the process cache?
                        $watchedItems[] = new WatchedItem(
                                $user,
-                               new TitleValue( (int)$row->wl_namespace, $row->wl_title ),
+                               $target,
                                $this->getLatestNotificationTimestamp(
                                        $row->wl_notificationtimestamp, $user, $target )
                        );
                foreach ( $rowBatches as $toInsert ) {
                        // Use INSERT IGNORE to avoid overwriting the notification timestamp
                        // if there's already an entry for this page
 -                      $dbw->insert( 'watchlist', $toInsert, __METHOD__, 'IGNORE' );
 +                      $dbw->insert( 'watchlist', $toInsert, __METHOD__, [ 'IGNORE' ] );
                        $affectedRows += $dbw->affectedRows();
                        if ( $ticket ) {
                                $this->lbFactory->commitAndWaitForReplication( __METHOD__, $ticket );