Forums / Developer / AdvancedObjectRelationList, how to do without ?

AdvancedObjectRelationList, how to do without ?

Author Message

Sébastien Morel

Tuesday 11 December 2007 3:59:50 am

Hi,

On several site, I use the configuration

[BackwardCompatibilitySettings]
AdvancedObjectRelationList=enabled

With this configuration I can define in a class an attribute "ObjectRelation". This attribute allows the user to create an object on the fly, directly linked to the attribute (the new object will not have a node assigment)

My question is : How to do reproduce this feature without this configuration, and moreover, is the configuration bad or depreacated ?

When I read this http://ez.no/doc/ez_publish/technical_manual/3_10/reference/datatypes/object_relations#comment15485

I don't know what to think about the configuration...

Thanks for your explanation ;)

Séb

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

Sebastiaan van der Vliet

Thursday 13 December 2007 7:06:59 am

Hi Sébastien,

Have a look at the objectrelationbrowse datatype:
http://ez.no/developer/contribs/datatypes/ezobjectrelationbrowse_datatype

Kind regards,
Sebastiaan

Certified eZ publish developer with over 9 years of eZ publish experience. Available for challenging eZ publish projects as a technical consultant, project manager, trouble shooter or strategic advisor.

Sébastien Morel

Friday 14 December 2007 4:13:03 am

Hi,

It's exactly that I meant.

Testing this extension I found a strange behavior, When I create a new object (an embedded object, at the first publishing, in the relation list there is two relation...

There is an example:
I have configure the atttribute (in the class article) with the default browse methode and permit the "create new object", and the new object will not be placed in the content tree.

The creation and the edition works fine, but the first time when I add a new object in the attribute, the list of relation (when I see the list in the admin interface) I have :

Related objects [2] Class Relation type
dqsdqsdqs Society Attribute ( Test extension )
dqsdqsdqs Society Attribute ( Title )

When I re-edit the object (which have the attribute) and that I just publish (without change anything) the relation become :
Related objects [2] Class Relation type
dqsdqsdqs Society Attribute ( Test extension )

Is it a bug ?

Thanks for your explantation

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

Sébastien Morel

Monday 17 December 2007 5:21:07 am

Hi,

has someone tested this extension? Did you encountered this bug ?

Thanks for your help.

Séb

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

Sebastiaan van der Vliet

Wednesday 19 December 2007 12:25:17 am

Hi Sébastien,

Could you send the screenshots to info[ at ]contactivity[ dot ]com, so I can have a look at it?

Certified eZ publish developer with over 9 years of eZ publish experience. Available for challenging eZ publish projects as a technical consultant, project manager, trouble shooter or strategic advisor.

Sébastien Morel

Saturday 22 December 2007 5:44:36 am

Hi,

Sebastiaan did you have the time to make researches ?

Thanks

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

Sébastien Morel

Thursday 28 May 2009 4:18:17 am

Hello,

I found a bug at line 1240 of datatype/ezobjectrelationbrowsetype.php

$object->addContentObjectRelation( $objectID, $ObjectVersion, $ContentObjectID, $contentClassAttributeID);

This line must be :

$object->addContentObjectRelation( $objectID, $ObjectVersion, $contentClassAttributeID,eZContentObject::RELATION_ATTRIBUTE);

according the declaration method in kernel/classes/ezcontentobject.php line 2565

function addContentObjectRelation( $toObjectID,
                                       $fromObjectVersion = false,
                                       $attributeID = 0,
                                       $relationType = eZContentObject::RELATION_COMMON )

Without this fix, the datatype works fine, but the relation and reverse relation list was wrong in the admin interface and moreover an bad record was present in ezcontentobject_link table.

Strangely, when you published the content a second time, the bug was self-fixed... (the ezcontentobject_link table was fixed by another way in the code)

++

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)