Unable to load abstract class when trying to load in drupal queue.

Created on 7 July 2017, over 7 years ago
Updated 17 September 2024, 3 months ago

In my module, I have implemented a queue to send out all digests as per the subscribed frequency. For this, I am using messsage_digest notifiers. Now when the cron job runs it aggregates all the messages and adds to the queue to be sent out. Now when the queue runs it tries to load the notifier class. Let's say digest_day notifier is being called and it tries to load the MessageDigestDay class. This class extends MessageDigest. Now when I am inside the queue worker function MessageDigest class is not found and it gives an error that MessagDigest class can not be found at (.....) location. This works everywhere else, just not inside the queue worker callback. If I explicitly include the abstract.inc file in all of my notifier class, it works fine.

Anyone having the same issue?

here is my code from worker callback:

$item = unserialize($item);

$uid = $item['uid'];

if(!isset($uid)) {
// log something here
return;
}

$notifier_name = $item['notifier'];
$message = $item['digest'];
$plugin = message_notify_get_notifier($notifier_name);
$class = ctools_plugin_load_class('message_notify', 'notifier', $notifier_name, 'class');
$notifier = new $class($plugin, new Message());

💬 Support request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇮🇳India asit

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.71.5 2024