Problem with collaboration cronjobs

Author Message

Michele Paoli

Monday 06 September 2010 1:34:08 am

I set up an installation of EzPublish 4.3 with a workflow to approve user registration.

To do this I configure a crontab, but if my admin user doesn't approve Item and delete it the cronjobs goes to crash with this message:

Fatal error: Call to a member function contentAttribute() on a non-object in /var/www/vhosts/technolift.com/httpdocs/kernel/classes/collaborationhandlers/ezapprove/ezapprovecollaborationhandler.php on line 107

I solved this problem patching ezapprovecollaborationhandler.php by inserting a control on static function contentObjectVersion( $collaborationItem ) :

from this:
static function contentObjectVersion( $collaborationItem ) {
$contentObjectID = $collaborationItem->contentAttribute( 'content_object_id' ); $contentObjectVersion = $collaborationItem->contentAttribute( 'content_object_version' );
return eZContentObjectVersion::fetchVersion( $contentObjectVersion, $contentObjectID );
}

to:

static function contentObjectVersion( $collaborationItem ) {
if(!empty($collaborationItem)) {
$contentObjectID = $collaborationItem->contentAttribute( 'content_object_id' ); $contentObjectVersion = $collaborationItem->contentAttribute( 'content_object_version' );
return eZContentObjectVersion::fetchVersion( $contentObjectVersion, $contentObjectID );
}
}

I'm sorry for my english...
Bye
Michele

Chen Xiongjie

Monday 06 September 2010 2:32:06 am

Hello Michele,

Can I have a question first: how did you delete the item? As far as I know normally you can not see the item before it's published.

Chen

eZ Comments: http://projects.ez.no/ezcomments
twitter: http://twitter.com/xiongjie

Michele Paoli

Tuesday 07 September 2010 1:09:04 am

The same thing that I ask to my customer.
i don't know how, but I found it deleted and crontab send me a lot of email with the classic message "Ez Publish get abrutly ended....", so comparing ezuser table with ezcontentobject and ez collaborationitem tables i found that an item in ezuser table was missed.

Michele

Chen Xiongjie

Tuesday 07 September 2010 2:17:01 am

OK.

As I know there are many cases which can result in this kind of fatal error. For example, deleting parent node(seemly not the case of deleting a pending user), or deleting an object which is in workflow pending after editing (it might happen here, but that's not for user registration).

The right solution should be not permitting user to delete it when there is object in workflow pending.

Related issue: http://issues.ez.no/IssueView.php?Id=6380

Feel free to have comment on that issue if you find something useful :).

Chen

eZ Comments: http://projects.ez.no/ezcomments
twitter: http://twitter.com/xiongjie

Michele Paoli

Tuesday 07 September 2010 5:33:22 am

Sure my customer cannot delete parent node.

i need more time to investigate.
Thank you a lot Chen.

Bye

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 30 2025 21:40:03
Script start
Timing: Jan 30 2025 21:40:03
Module start 'layout'
Timing: Jan 30 2025 21:40:03
Module start 'content'
Timing: Jan 30 2025 21:40:04
Module end 'content'
Timing: Jan 30 2025 21:40:04
Script end

Main resources:

Total runtime1.0293 sec
Peak memory usage8,192.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0041 588.2578151.2266
Module start 'layout' 0.00410.0030 739.4844220.7188
Module start 'content' 0.00711.0215 960.20314,475.5078
Module end 'content' 1.02860.0006 5,435.710915.8281
Script end 1.0293  5,451.5391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3369160.0002
Check MTime0.00120.1125160.0001
Mysql Total
Database connection0.00060.055910.0006
Mysqli_queries0.939691.2899630.0149
Looping result0.00050.0521610.0000
Template Total0.984595.720.4923
Template load0.00210.204220.0011
Template processing0.982495.446620.4912
Template load and register function0.00140.134210.0014
states
state_id_array0.00150.144010.0015
state_identifier_array0.00160.158920.0008
Override
Cache load0.00180.1761470.0000
Sytem overhead
Fetch class attribute can translate value0.00190.186020.0010
Fetch class attribute name0.00150.143970.0002
XML
Image XML parsing0.00290.278920.0014
class_abstraction
Instantiating content class attribute0.00000.0018100.0000
General
dbfile0.00350.3371220.0002
String conversion0.00000.000540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs