From e536eab2165fca1352b523b34579c83b9e50421e Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 2 Jul 2015 15:08:14 -0700 Subject: [PATCH] Avoid warnings on older queued EchoNotificationDeleteJobs Old jobs were queued with array( $userId => $userId ), so there will be no '0' index. Use array_values() since we don't care about the keys. Change-Id: I1155d310c7fa09c728797d35d63c7cec0383511c --- includes/jobs/NotificationDeleteJob.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/jobs/NotificationDeleteJob.php b/includes/jobs/NotificationDeleteJob.php index 757e61b56..ba7f36e3e 100644 --- a/includes/jobs/NotificationDeleteJob.php +++ b/includes/jobs/NotificationDeleteJob.php @@ -46,7 +46,9 @@ class EchoNotificationDeleteJob extends Job { $notifMapper = new EchoNotificationMapper(); $targetMapper = new EchoTargetPageMapper(); - $userId = $this->userIds[0]; + // Back-compat for older jobs which used array( $userId => $userId ); + $userIds = array_values( $this->userIds ); + $userId = $userIds[0]; $user = User::newFromId( $userId ); $notif = $notifMapper->fetchByUserOffset( $user, $wgEchoMaxUpdateCount ); if ( $notif ) {