eZ Community » Forums » Extensions » eZ Flow » Cronjob for dynamic content not...
expandshrink

Cronjob for dynamic content not working: debug errors found

Cronjob for dynamic content not working: debug errors found

Wednesday 03 October 2012 7:56:08 pm - 4 replies

Hi. We had to recreate database this morning. somehow (maybe cahces) has made the cronjob to NOT work as expected for ezflow. It wont load newest contents.

I found out this debug while running manually the cronjob as it was not working correctly, it was not updating content, but Im not sure if this errors may have in fact stopped the process and make it work.

 

#################################### DEBUG ####################################Timing: ()Script extension/ezflow/cronjobs/ezflowupdate.php starting
Notice: (PHP: E_NOTICE)Undefined index: modified_subnode in /home/www/ezpublish/extension/ezflow/classes/fetches/ezflowlatestobjects.php on line 35

Error: (eZContentObject::fetchByNodeID())Object not found with node id 1402
Timing: ()Script extension/ezflow/cronjobs/ezflowupdate.php done
Total script time: 0.1355 sec

Wednesday 03 October 2012 8:12:59 pm

OK at least I made cronjobs work... somehow crondaemon was stopped by the server... Still trying to find out about the object not found error in ezflow.. the Node does exist.

Also de Undefined index modified_subnode etc... warning Im not sure how it may affect.

Thursday 04 October 2012 9:31:15 am

Hi.
From a PHP point of view, the message you see is of type e_notice.  Because PHP is such a forgiving language (good or bad), then there is lots of code that would trigger this class of message.  That's why e_notice is never enabled on a live website.

What causes the specific message:

Code has tried to access an element of an array (or similiar, a property of an object) that does not exist:

$foo = array(width=>'154cm', color=>'blue', height=>'222cm');

If I try to do something like:

$color = $foo['color']; //returns blue

$length = $foo['length'] // returns null (which happily casts to zero or false in PHP) AND silently triggers an e_warning - undefined index

_______________________________________________________________

So, I am not saying for sure that you should ignore it completely, knowing quite a bit of the coding style underneath the hood of eZ Publish and its eztensions, I would say there are plenty of times where a message like that could possibly exist.  Assuming an object or assuming children of a node, etc.

But in this case, there is something possibly look at because not having a modified_subnode would make me assume that the set before that (fetching a node) failed because modified_subnode is a standard node property.. In the case of exflow, I could envision this being the case if the underlying content has changes sine ezflow was last modified.

To look further into the issue, you can walk backwards through the steps in the code, enable some form of debugging or debug_back-trace, etc starting with ezflowlatestobjects.php.  Unfortunately, to trigger a debug_backtrace on this error message, I believe you would have to create a custom error handler  using set_error_handler to catch the UndefinedIndex sad.gif Emoticon

-David

Thursday 04 October 2012 9:47:03 am

This sometimes happens when an object was deleted from your content repository after it was added to an eZ Flow block. I say "sometimes" because I might think that it depends on your eZ Flow version.

Monday 22 October 2012 5:21:25 pm

Thank you both guys... I think the problem was just as you said, the object was not there anymore. The problem seems to be gone, this has been solved. Thanks!

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from