Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/222495

Change subject: Avoid warnings on older queued EchoNotificationDeleteJobs
......................................................................

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
---
M includes/jobs/NotificationDeleteJob.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/95/222495/1

diff --git a/includes/jobs/NotificationDeleteJob.php 
b/includes/jobs/NotificationDeleteJob.php
index 757e61b..ba7f36e 100644
--- a/includes/jobs/NotificationDeleteJob.php
+++ b/includes/jobs/NotificationDeleteJob.php
@@ -46,7 +46,9 @@
                $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 ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/222495
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1155d310c7fa09c728797d35d63c7cec0383511c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to