Forums / Developer / [solved] Digest screws up

[solved] Digest screws up

Author Message

Clemens T

Tuesday 22 November 2005 5:44:13 am

Heya all,

The digest of ezpublish 3.7.0 screws up. It does not work when I try to use it (even on a somewhat fresh install of 3.7.0). I only use the '/notification/settings' to interact with ezpublish.

Does everyone have this problem? Is it a bug/feature? Please let me know WHAT you need to help me solve this problem.. cause my customers would like the digest!

Thanks,
Clemens

Clemens T

Wednesday 23 November 2005 3:27:03 pm

The problem occurs in:
/kernel/notification/eznotificationfunctioncollection.php

on line:78

75    function eventContent( $eventID )
76    {
77        $event = eZNotificationEvent::fetch( $eventID );
78        return array( 'result' => $event->content() );
79    }

The $event variable is an array() (when running the notification cronjob), so the ->content() function cannot be called on an array ( at best at it's elements.. but that's not the case in the ezcore file). So, again: is this a bug?

Thanks,
Clemens

Frederik Holljen

Thursday 24 November 2005 1:23:03 am

What behavior do you experience? (and what do you expect?)

Clemens T

Thursday 24 November 2005 1:33:33 am

case: Ok, I have a few contentobjects.. and I'd like to know when they change. Problem is: if I change like 40 of them, my customers get 40 mails. The best thing would be to di-gest them in 1 mail, so 'they' don't see it as spam.

current di-gest behaviour:

Mail is NOT sent, and I get the following error on runcronjobs.php (with debug output):

Fatal error: Call to a member function on a non-object in /opt/guide/www.blaat.com/ezpublish-3.7.0/kernel/notification/eznotificationfunctioncollection.php on line 79 Fatal error: eZ publish did not finish its request The execution of eZ publish was abruptly ended, the debug output is present below. 

I believe this error is caused by the ->content() function on the array().. the array() is not an object, but the elements IN te array are objects.

problem is: this could lead to an inconsistent database.

note: the objects that are 'digested' still exist, so that's not the issue with the non-object fatal error.

.....

Expected behaviour:
The mail we sent to people is bundled (digested) in 1 mail which is sent on the proper time.

Nathan Sharp

Friday 09 December 2005 5:28:18 pm

I have the same problem. Looks like a bug in eznotificationevent::fetch. Edit kernel/classes/notification/eznotificationevent.php and change the fetch function to call ezpersistentobject::fetchObject instead of fetchObjectList:

    function fetch( $eventID )
    {
        return eZPersistentObject::fetchObject( eZNotificationEvent::definition(),
                                                        null,  array( 'id' => $eventID ));
    }

Clemens T

Sunday 11 December 2005 1:50:56 pm

Can't believe someone of the ezpublish crew doesn't answer this one..
I'll see if I can fix it tomorrow!

Thanks.. I'll let you know if it worked!

Kåre Køhler Høvik

Sunday 11 December 2005 11:06:06 pm

We've now started looking at it.

Kåre Høvik

Clemens T

Monday 12 December 2005 12:42:25 pm

Nathan, well done.. that seems to be the problem.

Really a tough one!
Thanks.

I'm now going to test it extensively.. to make sure it works on all possible ways. If no new subpost here.. then it's fixed.

Thanks again!!

eZ debug

Timing: Jan 18 2025 15:05:43
Script start
Timing: Jan 18 2025 15:05:43
Module start 'content'
Timing: Jan 18 2025 15:05:43
Module end 'content'
Timing: Jan 18 2025 15:05:43
Script end

Main resources:

Total runtime0.2858 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 587.7031180.8438
Module start 'content' 0.00670.0073 768.5469101.9922
Module end 'content' 0.01410.2716 870.5391530.1484
Script end 0.2856  1,400.6875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00401.3861200.0002
Check MTime0.00170.6054200.0001
Mysql Total
Database connection0.00100.354810.0010
Mysqli_queries0.231580.98881410.0016
Looping result0.00170.60291390.0000
Template Total0.271194.810.2711
Template load0.00100.363510.0010
Template processing0.270094.469610.2700
Override
Cache load0.00070.238610.0007
Sytem overhead
Fetch class attribute can translate value0.00080.292910.0008
XML
Image XML parsing0.00030.105010.0003
General
dbfile0.00270.9302200.0001
String conversion0.00000.002130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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