Forums / General / object relations update

object relations update

Author Message

Nathalie Grimaud

Friday 06 January 2006 9:03:12 am

I'd like to have your opinion on a strange phenomenon I've faced with ; this concern the object relations.

<b>Context :</b>
<i>Object 1</i>
attribute : Title
datatype : Text Line
content : 'Title Object 1'

<i>Object 2</i>
attribute : Related object
datatype : Object Relations
content : Object 1

In the template of Object 1 I look for all the objects related to Object 1, doing :
{def $objects=fetch('content','search',hash('text',$node.name,'class_id',37,'class_attribute_id',345))}
with
37 = id of the Object 2 class
345 = id of the Related object attribute

Until this point there's no problem, I easily recover Object 2.

<b>Problem :</b>
When I change the Title of Object 1 for exemple from 'Title Object 1' to 'New Title Object 1'
<b>Admin Side :</b>
I refresh the Object 2 , the object relation is updated and now it points to 'New Title Object 1'. -> OK.

<b>Web Side :</b>
I refresh the display of Object 1 , the Object 2 has disappeared ! It seems that the fetch function doesn't reconize the new title of my related object.

<b>Solutions explored :</b>
clear all caches : no change in front side
edit Object 2 without change and republish it : no change in front side
edit Object 2, remove the object relation to Object 1 and immediatly add it again : the Object 2 is back in front side!

Does someone has any explanation on the way the object relations in attributes are updated and why this update is not recognize in the front side ?

Xavier Dutoit

Saturday 07 January 2006 6:45:13 am

Salut,

You aren't using the object relation feature here, but the search (restricted to an attribute)

The fetch reverse is documented there:

http://ez.no/doc/ez_publish/technical_manual/3_6/reference/modules/content/fetch_functions/reverse_related_objects

The related_objects isn't documented, but works the same.

X+

P.S. Have a look at this extension, it might be easier in your case to create the editing interface:
http://ez.no/community/contribs/datatypes/enhanced_objectrelation and provides some examples about how to use the related objects.

http://www.sydesy.com

Yannick Komotir

Wednesday 17 December 2008 11:37:55 am

Hi,

somebody for asking this problem? the same problem can see here http://ez.no/developer/forum/install_configuration/object_relation_type.

Thank's

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

eZ debug

Timing: Jan 18 2025 15:14:23
Script start
Timing: Jan 18 2025 15:14:23
Module start 'content'
Timing: Jan 18 2025 15:14:24
Module end 'content'
Timing: Jan 18 2025 15:14:24
Script end

Main resources:

Total runtime0.8362 sec
Peak memory usage4,096.0000 KB
Database Queries196

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.7344180.8516
Module start 'content' 0.00550.6998 769.5859590.9219
Module end 'content' 0.70530.1308 1,360.5078332.7656
Script end 0.8361  1,693.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.4995210.0002
Check MTime0.00150.1780210.0001
Mysql Total
Database connection0.00080.095710.0008
Mysqli_queries0.760890.98561960.0039
Looping result0.00210.24941940.0000
Template Total0.802195.920.4011
Template load0.00190.230120.0010
Template processing0.800295.695620.4001
Template load and register function0.00010.016910.0001
states
state_id_array0.00150.182710.0015
state_identifier_array0.00090.109520.0005
Override
Cache load0.00160.1962450.0000
Sytem overhead
Fetch class attribute can translate value0.00100.115940.0002
Fetch class attribute name0.00130.153250.0003
XML
Image XML parsing0.00130.149740.0003
class_abstraction
Instantiating content class attribute0.00000.001450.0000
General
dbfile0.00380.4566330.0001
String conversion0.00000.000530.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/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: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs