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.