Page MenuHomePhabricator

foreach() argument must be of type array|object, bool given
Closed, ResolvedPublic

Description

MediaWiki1.39.4
PHP8.0.28 (cgi-fcgi)
MySQL8.0.28-0ubuntu0.20.04.3
CommentStreams8.0-dev (6b3a3ed)

Monitoring my error logs turned up the following:

2023-07-30 19:22:34 vps##### my_site_: [ZMa4egRUU0EnKv8CqPYMwAAAAAU] /w/api.php   PHP Warning: foreach() argument must be of type array|object, bool given
#0 /home/my_user/mysite.com/w/extensions/CommentStreams/includes/CommentStreamsStore.php(722): MWExceptionHandler::handleError(integer, string, string, integer)
#1 /home/my_user/mysite.com/w/extensions/CommentStreams/includes/EchoInterface.php(165): MediaWiki\Extension\CommentStreams\CommentStreamsStore->getWatchers(integer)
#2 /home/my_user/mysite.com/w/extensions/Echo/includes/controller/NotificationController.php(447): MediaWiki\Extension\CommentStreams\EchoInterface::locateUsersWatchingComment(EchoEvent)
#3 /home/my_user/mysite.com/w/extensions/Echo/includes/controller/NotificationController.php(478): EchoNotificationController::evaluateUserCallable(EchoEvent, string)
#4 /home/my_user/mysite.com/w/extensions/Echo/includes/controller/NotificationController.php(115): EchoNotificationController::getUsersToNotifyForEvent(EchoEvent)
#5 /home/my_user/mysite.com/w/extensions/Echo/includes/model/Event.php(190): EchoNotificationController::notify(EchoEvent, boolean)
#6 /home/my_user/mysite.com/w/extensions/CommentStreams/includes/EchoInterface.php(144): EchoEvent::create(array)
#7 /home/my_user/mysite.com/w/extensions/CommentStreams/includes/ApiCSPostReply.php(119): MediaWiki\Extension\CommentStreams\EchoInterface->sendReplyNotifications(MediaWiki\Extension\CommentStreams\Reply, WikiPage, User, MediaWiki\Extension\CommentStreams\Comment)
#8 /home/my_user/mysite.com/w/includes/api/ApiMain.php(1900): MediaWiki\Extension\CommentStreams\ApiCSPostReply->execute()
#9 /home/my_user/mysite.com/w/includes/api/ApiMain.php(875): ApiMain->executeAction()
#10 /home/my_user/mysite.com/w/includes/api/ApiMain.php(846): ApiMain->executeActionWithErrorHandling()
#11 /home/my_user/mysite.com/w/api.php(90): ApiMain->execute()
#12 /home/my_user/mysite.com/w/api.php(45): wfApiMain()
#13 {main}

Event Timeline

Change 943655 had a related patch set uploaded (by Cicalese; author: Cicalese):

[mediawiki/extensions/CommentStreams@master] Fix Echo event error when no watchers

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

Change 943655 merged by jenkins-bot:

[mediawiki/extensions/CommentStreams@master] Fix Echo event error when no watchers

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

cicalese claimed this task.
cicalese moved this task from In Progress to Closed on the MediaWiki-extensions-CommentStreams board.
cicalese subscribed.

Thank you for reporting this.

Change 947465 had a related patch set uploaded (by Cicalese; author: Cicalese):

[mediawiki/extensions/CommentStreams@REL1_39] Fix Echo event error when no watchers

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

Change 947906 had a related patch set uploaded (by Cicalese; author: Cicalese):

[mediawiki/extensions/CommentStreams@REL1_40] Fix Echo event error when no watchers

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

Change 947465 merged by jenkins-bot:

[mediawiki/extensions/CommentStreams@REL1_39] Fix Echo event error when no watchers

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

Change 947906 merged by jenkins-bot:

[mediawiki/extensions/CommentStreams@REL1_40] Fix Echo event error when no watchers

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