Forums / General / Object Relations / Comment32110

Author Topic

Xavier Dutoit

Wednesday 24 August 2005 7:38:37 am

Comment32110

I wasn't aware of this new function on 3.6.

Roberto, could you try using
http://ez.no/download/changelogs/ez_publish_3_6/new_features/advanced_related_objects

{def $objects=fetch( content, reverse_related_objects, hash( object_id, $node.contentobject_id, attribute_identifier, 'books/authors' ) )}

Play around the "books/authors" as the attribute if it doesn't work.

As if you want to modify the default behavior to revert it to how it worked before (put them into the reverse_related list) :

modify kernel/classes/ezcontentobject.php

    function &reverseRelatedObjectList( $version = false, $toObjectID = false, $
attributeID = 0 )
    {
...
       $relatedObjects =& $db->arrayQuery( "SELECT DISTINCT ezcontentobject.*
                                   FROM
                                     ezcontentobject, ezcontentobject_link
                                   WHERE
                                     ezcontentobject.id=ezcontentobject_link.fro
m_contentobject_id AND
                                     ezcontentobject.status=" . EZ_CONTENT_OBJEC
T_STATUS_PUBLISHED . " AND
                                     ezcontentobject_link.to_contentobject_id=$toObjectID AND
                                     ezcontentobject_link.from_contentobject_version=ezcontentobject.current_version );


Basically, delete "AND contentclassattribute_id=$attributeID"

at the end of the query.

X+

http://www.sydesy.com