Trying to access array offset on value of type bool in Drupal\message_subscribe\Subscribers->sendMessage()

Created on 31 December 2020, over 3 years ago
Updated 28 February 2024, 4 months ago

Steps to reproduce

Just send message using the queue system
Here is the error log when the message is sent:

Notice: Trying to access array offset on value of type bool in Drupal\message_subscribe\Subscribers->sendMessage() (line 255 of modules/contrib/message_subscribe/src/Subscribers.php).
Drupal\message_subscribe\Subscribers->sendMessage(Object, Object, Array, Array, Array) (Line: 69)
Drupal\message_subscribe\Plugin\QueueWorker\MessageSubscribe->processItem(Array) (Line: 109)
Drupal\ultimate_cron\QueueWorker->queueCallback(Object)

Proposed resolution

In modules/contrib/message_subscribe/src/Subscribers.php, line 255, change $subscribe_options['queue']['end time'] into $subscribe_options['end time'] as it looks like this 'end time option is configured separately; see line 148 in the same file:

   $subscribe_options += [
      'save message' => TRUE,
      'skip context' => FALSE,
      'last uid' => 0,
      'uids' => [],
      'range' => $use_queue ? 100 : FALSE,
      'end time' => FALSE,
      'use queue' => $use_queue,
      'queue' => FALSE,
      'entity access' => TRUE,
      'notify blocked users' => FALSE,
      'notify message owner' => $notify_message_owner,
    ];

Remaining tasks

Create a patch

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium DuneBL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024