Forums / General / Inverted related objects not updated

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

eZ debug

Timing: Jan 18 2025 05:22:23
Script start
Timing: Jan 18 2025 05:22:23
Module start 'content'
Timing: Jan 18 2025 05:22:24
Module end 'content'
Timing: Jan 18 2025 05:22:24
Script end

Main resources:

Total runtime1.5055 sec
Peak memory usage4,096.0000 KB
Database Queries205

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 588.8594180.8359
Module start 'content' 0.00691.3273 769.6953609.2188
Module end 'content' 1.33420.1712 1,378.9141337.0625
Script end 1.5054  1,715.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.2726210.0002
Check MTime0.00170.1110210.0001
Mysql Total
Database connection0.00150.097410.0015
Mysqli_queries1.423994.58012050.0069
Looping result0.00220.14612030.0000
Template Total1.467697.520.7338
Template load0.00210.139920.0011
Template processing1.465597.346520.7328
Template load and register function0.00010.009210.0001
states
state_id_array0.00140.095310.0014
state_identifier_array0.00200.136020.0010
Override
Cache load0.00180.1188370.0000
Sytem overhead
Fetch class attribute can translate value0.00140.090440.0003
Fetch class attribute name0.00110.070470.0002
XML
Image XML parsing0.00100.068940.0003
class_abstraction
Instantiating content class attribute0.00000.000870.0000
General
dbfile0.00330.2168280.0001
String conversion0.00000.000330.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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