Inverted related objects not updated

Author Message

Gwenal Le Bihan

Tuesday 03 February 2009 9:47:26 am

Hi,

I have this message in the error.log :

[ Jan 05 2009 15:08:08 ] [192.168.1.116] 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

Gwen

Gwenal Le Bihan

Wednesday 04 February 2009 2: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.. :-$

G

Gwenal Le Bihan

Wednesday 04 February 2009 3:09:50 am

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 :-(

anybody to confirm?..

thx

Gwen

Fabien Mas

Thursday 05 February 2009 6:40:18 am

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 ??

Fabien

André R.

Thursday 05 February 2009 9:44:46 am

>> Is it a bug?

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

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Fabien Mas

Friday 06 February 2009 12:39:20 am

It's done :
http://issues.ez.no/IssueView.php?Id=14411&activeItem=1

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:44:37
Script start
Timing: Jan 30 2025 21:44:37
Module start 'layout'
Timing: Jan 30 2025 21:44:37
Module start 'content'
Timing: Jan 30 2025 21:44:38
Module end 'content'
Timing: Jan 30 2025 21:44:38
Script end

Main resources:

Total runtime0.7273 sec
Peak memory usage8,192.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.1328151.2109
Module start 'layout' 0.00530.0037 739.3438220.7031
Module start 'content' 0.00900.7175 960.04694,511.6016
Module end 'content' 0.72650.0008 5,471.648415.8438
Script end 0.7272  5,487.4922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4790160.0002
Check MTime0.00130.1828160.0001
Mysql Total
Database connection0.00060.087310.0006
Mysqli_queries0.633687.1170680.0093
Looping result0.00070.0947660.0000
Template Total0.674392.720.3371
Template load0.00180.247420.0009
Template processing0.672592.461320.3362
Template load and register function0.00170.228310.0017
states
state_id_array0.00180.247310.0018
state_identifier_array0.00180.247220.0009
Override
Cache load0.00160.2191370.0000
Sytem overhead
Fetch class attribute can translate value0.00170.237330.0006
Fetch class attribute name0.00210.289170.0003
XML
Image XML parsing0.00070.101230.0002
class_abstraction
Instantiating content class attribute0.00000.001970.0000
General
dbfile0.00090.1289170.0001
String conversion0.00000.001040.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
6content/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
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs