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 !

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 05:11:37
Script start
Timing: Jan 18 2025 05:11:37
Module start 'layout'
Timing: Jan 18 2025 05:11:37
Module start 'content'
Timing: Jan 18 2025 05:11:37
Module end 'content'
Timing: Jan 18 2025 05:11:37
Script end

Main resources:

Total runtime0.0170 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 590.3594152.6406
Module start 'layout' 0.00650.0033 743.000039.4609
Module start 'content' 0.00980.0051 782.460994.5078
Module end 'content' 0.01490.0021 876.968834.3047
Script end 0.0170  911.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002615.4257140.0002
Check MTime0.00116.6904140.0001
Mysql Total
Database connection0.00127.251310.0012
Mysqli_queries0.003620.908930.0012
Looping result0.00000.099310.0000
Template Total0.00179.910.0017
Template load0.00095.062210.0009
Template processing0.00084.816010.0008
Override
Cache load0.00063.414410.0006
General
dbfile0.00021.458980.0000
String conversion0.00000.062940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs