Closed (fixed)
Project:
Subscriptions
Version:
4.7.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Jan 2007 at 18:45 UTC
Updated:
1 Dec 2007 at 00:48 UTC
Hello,
I am having the subscriptions module send notifications using cron and also testing held posts before sending. Occasionally cron will stop running, as reported in the drupal logs as 'Previous cron did not finish', and if I manually go to example.com/cron.php I get the following error:
Fatal error: Cannot use object of type stdClass as array in /home/clients/ymb/public_html/sandbox/modules/subscriptions/subscriptions.module on line 439
The error is caused because $content in the function subscriptions_testpost() is not being unserialized into an array, I believe. But, I'm not sure how come this is happening.
Thanks.
Comments
Comment #1
arthurf commentedHi-
would you do me a favor and either let me know what your line 439 is or try out the cvs 4.7 branch code? I'm looking at what I think is the line your reporting is failing and either I'm looking at the wrong code or something wacky is going on.
thanks
Comment #2
coltraneThanks for getting back to me arthurf.
Line 439:
I've tried out the recent branch code and seen that there some checks in place for $content. So far I have not experienced this error but with the old code it wouldn't show up right away, which is odd. I had enabled cron and test held posts and it worked fine for a bit. I wasn't able to identify what post/comment caused it to break.
Thanks, I'll post follow up if I experience the error again.
Comment #3
coltraneI found another error related to this and specifically associated with the new checks. The error occurred when a user was trying to make a comment on a post.
Fatal error: Cannot use object of type stdClass as array in /home/clients/ymb/public_html/modules/subscriptions/subscriptions.module on line 611
Line 611 is:
The problem I think is that is_null() there can still evaluate true on an object, so what is better is:
Comment #4
bdragon commentedNo longer relevant, please test against 5.x-2.0 beta.