This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » General » Inverted related objects not updated

Inverted related objects not updated

Inverted related objects not updated

Tuesday 03 February 2009 6:47:26 pm - 5 replies


I have this message in the error.log :

[ Jan 05 2009 15:08:08 ] [] eZContentObject::fetch():
Object not found (7204)

I've deleted an object (id 7204) from the media that was related with an article in the contents (object relation). I had a message warning me that there was a relation with the article, but i still erased the object, thinking that the data_int value would be set to 0 instead of remaining set to 7204, but it's not! As a result, even if in the admin when i edit the article, my object relation is showing 'no relation', on the front end, it's causing a message in the error.log, it's still trying to fetch this 'no longer existing' object.

Is this a normal behaviour that deleting an object doesn't update the (inverted) related objects? I'm using eZ4.0.1..

Thank you very much


Wednesday 04 February 2009 11:49:19 am

A little precision..

It only happens when i delete the relate object without leaving it in the trash. There is no update of my "calling" object in this case but if i delete the related object and leave it in the trash, then my "calling" object is updated and the related object attribute value is set to 0.

I can't see why there is a difference between the two operations..

I hope I'm clear in my explanations.. :-$


Wednesday 04 February 2009 12:09:50 pm

oups little mistake: the attribute "calling" object is not set to 0 when the deleted related object is left in the trash. It seems i don't have an error in my log just because the fetch is still possible even if placed in the trash but it doesn't answer my first question about the update of my attribute, if this is a normal behaviour.

I would assume that removing an object updates all reverse related objects but it seems it's not the case sad.gif Emoticon

anybody to confirm?..



Thursday 05 February 2009 3:40:18 pm

When you delete an object, the "fixReverseRelations" function (ezcontentobject.php) is called

This function call the "fixRelatedObjectItem" function of the datatype linked to your object

In your case, the datatype is : ezobjectrelation
But the fixRelatedObjectItem is not implemented in this datatype so , the fixRelatedObjectItem function used here is the one of the eZDataType class who does nothing

 function fixRelatedObjectItem( $contentObjectAttribute, $objectID, $mode )

Is it a bug ??


Modified on Thursday 05 February 2009 3:53:08 pm by Fabien Mas

Thursday 05 February 2009 6:44:46 pm

>> Is it a bug?

Yes, please create a issue for it and add a link to this thread in it.

Friday 06 February 2009 9:39:20 am

It's done :

Modified on Friday 06 February 2009 9:40:01 am by Fabien Mas


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

36 542 Users on board!

Forums menu

Proudly Developed with from