Forums / Extensions / eZ Newsletter / Cronjob and fatal error

Cronjob and fatal error

Author Message

laurent le cadet

Friday 17 October 2008 8:16:04 am

Hi,

I have a problem with cronjob and eznewsletter.php.

Cronjob output:

PHP Fatal error: Call to a member function on a non-object in /home/mysite/public_html/extension/eznewsletter/classes/eznewsletter.php on line 1223

Someone can help me?

Regards.

Laurent

Christian Rößler

Friday 17 October 2008 8:59:02 am

Hy,

i'm currently installing eznewsletter extension and digged through eznewsletter.php in /extension/eznewsletter/classes but my file hasn't so much lines in it .

My Version is from svn: http://svn.ez.no/svn/extensions/eznewsletter/ezp4/trunk as i needed a reference-implementation without ezpkg-stuff around it. I Also wanted to try out eznewsletter with ez 4.0.1...

What Version of ezNewsletter / ezPublish do you have?

According to your errormessage i would shoot into the direction of autoload-array for extensions... Have you added eznewsletter to the extension-autoload-array? (well, i think you have)

Can you post the function / object that causes the errormessage?

Regards,
Chris.

Hannover, Germany
eZ-Certified http://auth.ez.no/certification/verify/395613

Roland TRAN

Tuesday 30 December 2008 2:43:42 am

Hello everybody,

I have nearly the same problem like Laurent when I am running the cronjob (php runcronjobs.php -s send_newsletter).

I can send previews of my personnalized newsletters but when I trying to send by using the cronjob, this error message appears :

Archiving newsletter: 18 New "Newsletter issue" newsletter.
PHP Fatal error:  Call to a member function attribute() on a non-object in /home/mysite/public_html/extension/eznewsletter/classes/eznewsletter.php on line 583

It is corresponding to :

        $newsletter_type = eZNewsletterType::fetch( $newsletterTypeID );
echo $newsletterTypeID; //a line I add to see the ID and It works
        $send_date_modifier = $newsletter_type->attribute( 'send_date_modifier' );
        $pretext = $newsletter_type->attribute('pretext');
        $posttext = $newsletter_type->attribute('posttext');

If someone have some idea or can help me, it would be helpful.
Thanks a lot.
Roland

Roland TRAN

Tuesday 30 December 2008 5:48:35 am

Yeah !

I have found the problem ! I have forgotten to specified the access in my cronjob :

php runcronjobs.php -s mysite_admin send_newsletter

And now it is working !