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.
I get the following error from line 762 in notifications.module:
array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer
Changing that line from
if ($refresh || !array_key_exists($sid, $cache)) {
to
if ((is_numeric($sid) && ($refresh || !array_key_exists($sid, $cache)))) {
seems to fix the problem but I'm not 100% sure non-existent sid's should be possible?
Comments
Comment #1
samhassell CreditAttribution: samhassell commentedI should add that the error occurs when submitting a comment that has been subscribed to. That subscription is XMPP-based, but the user doesn't have an account name entered. So I guess notifications should handle a situation where another module passes it a null value.
Comment #2
Jose Reyero CreditAttribution: Jose Reyero commentedThis is the same as #432556: Error during queue process / post submission: warning: array_key_exists()
No, we are not fixing this in Notifications. It is the og plug-in passing the wrong parameters, and we need to fix it there.