Forums / Install & configuration / Problem with collaboration cronjobs

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