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

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

Main resources:

Total runtime0.6903 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 587.8828152.6094
Module start 'layout' 0.00660.0038 740.492239.4141
Module start 'content' 0.01040.6784 779.9063585.8594
Module end 'content' 0.68880.0014 1,365.765612.1875
Script end 0.6902  1,377.9531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.5230160.0002
Check MTime0.00140.2034160.0001
Mysql Total
Database connection0.00090.126210.0009
Mysqli_queries0.632791.6633590.0107
Looping result0.00090.1238570.0000
Template Total0.660195.620.3300
Template load0.00210.305020.0011
Template processing0.657995.316720.3290
Template load and register function0.00020.033310.0002
states
state_id_array0.00080.109410.0008
state_identifier_array0.00090.133720.0005
Override
Cache load0.00200.2863450.0000
Sytem overhead
Fetch class attribute can translate value0.00060.083030.0002
Fetch class attribute name0.00100.139050.0002
XML
Image XML parsing0.00130.189930.0004
class_abstraction
Instantiating content class attribute0.00000.001150.0000
General
dbfile0.00110.1616220.0001
String conversion0.00000.003240.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
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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs