Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When sending notifications for new group content, I ran across an issue where I would get the following PHP error:
Error: Unsupported operand types in Notifications_Event->send_all() (line 463 of /srv/bindings/681a10580b0146f1850e945b5adbae8a/code/profiles/schoolyard/modules/contrib/notifications/notifications.event.inc).
I noticed in this scenario the send_all() function in notifications.event.inc the $success
variable was being set to an empty array. This caused an issue with this line:
$errors = $sent - $success;
Comment | File | Size | Author |
---|---|---|---|
#4 | notifications-unsupported-operand-2945180-3.patch | 743 bytes | jacob.embree |
#2 | 2945180-unsupported-operand.patch | 849 bytes | kevin_martin |
Comments
Comment #2
kevin_martin CreditAttribution: kevin_martin commentedComment #3
jacob.embree CreditAttribution: jacob.embree at St. Louis Integration commentedI think
$success
should always be an integer, so setting the default value to an empty array seems incorrect to me. Please test with this patch that sets'success'
to 0 by default.Comment #4
jacob.embree CreditAttribution: jacob.embree at St. Louis Integration commented