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
This commit is contained in:
Kunal Mehta 2015-07-02 15:08:14 -07:00
parent a7c36b0b86
commit e536eab216

View file

@ -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 ) {