// @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 );
}
$oldRev = $this->revisionLookup->getRevisionById( $oldid );
+ if ( !$oldRev ) {
+ // Oldid given but does not exist (probably deleted)
+ return false;
+ }
+
$nextRev = $this->revisionLookup->getNextRevision( $oldRev );
if ( !$nextRev ) {
// Oldid given and is the latest revision for this title; clear the timestamp.