I'm getting this error when cron runs:

Notice: Undefined offset: 0 in _subscriptions_mail_cron() (line 84 of /var/www/sites/all/modules/subscriptions/subscriptions_mail.cron.inc).

Not sure if this is a bug or something I've screwed up, the logs aren't telling me anything useful.

Comments

salvis’s picture

Title: Error on cron run » Undefined offset: 0 in _subscriptions_mail_cron()

Which Subscriptions modules do you have enabled?

As a quick test, does it help if you enable all of them?

salvis’s picture

Category: support » bug
Status: Active » Fixed

I've just pushed a fix to the -dev version for this — thank you for your report!

Be sure to clear the cache after updating to the -dev version!

Please let us know what you find...

vegantriathlete’s picture

I am running the 7.x-1.0-alpha5 version and get the following errors (for each piece of content that is triggering a notification) on cron run (see attached screen shots):

Undefined offset: 0 in _subscriptions_mail_cron() (line 84 . . .
Undefined variable: body in _subscriptions_mail_cron() (line 103 . . .
Undefined variable: mailvars in _subscriptions_mail_cron() (line 108 . . .
Undefined variable: mailvars in _subscriptions_mail_cron() (line 109 . . .

I'll have to install the -dev and see what happens

I also get the following:

Warning: Invalid argument supplied for foreach() in _subscriptions_mail_send() (line 248 . . .

Is this also fixed in the latest -dev? Or should I open a separate issue?

salvis’s picture

The -dev version has a lot of fixes by now. ALPHA6 is ready, but it also requires an update to Mail Editor, which has some issues that I was hoping to fix before publishing the update.

Please hold off reporting bugs unless you're using the latest -dev version. We'll take a fresh start with ALPHA6.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

akkedirk’s picture

Title: Undefined offset: 0 in _subscriptions_mail_cron() » Undefined variable: body in _subscriptions_mail_cron()
Version: 7.x-1.x-dev » 7.x-1.0-alpha6
Status: Closed (fixed) » Active

Running alpha6 version and, when running cron, still getting :

Notice: Undefined variable: body in _subscriptions_mail_cron() (line 104 ...
Notice: Undefined variable: mailvars in _subscriptions_mail_cron() (line 109 ...
Notice: Undefined variable: mailvars in _subscriptions_mail_cron() (line 110 ...
Warning: Invalid argument supplied for foreach() in _subscriptions_mail_send() (line 249 ...

And notifications are NOT sent.

This only occurs when Digest mode is turned on for at least one user. Turning Digest mode off makes the problem go away.

salvis’s picture

Title: Undefined variable: body in _subscriptions_mail_cron() » Undefined offset: 0 in _subscriptions_mail_cron()
Version: 7.x-1.0-alpha6 » 7.x-1.x-dev
Status: Active » Closed (fixed)

Turning Digest mode off makes the problem go away.

Exactly. We know that Digest Mode is not working in ALPHA6.

salvis’s picture

Please see #1327376-8: Implementing digest mode for D7 — feel free to reopen this issue if this is still a problem with the -dev (or upcoming BETA1) version.