ez projects / objectrelationbrowse / forum / general / bad relations created
You need to be logged in to post messages in the forums. New users may register here.
Member since: Posts: 3 |
Wednesday 04 August 2010 3:00:41 pm I was having a problem with relations involving object relation browse objects occasionally showing more related objects than they should -- for some items there was a duplicate relation listed in the admin view but instead of the "Relation type" indicating "Attribute(Awardee)" as it should, it instead said "Attribute()." I assume that is why the fetch is returning duplicate objects. When I looked at the ezcontentobject_link table I saw that for these items there was one row with the proper values and a second that had identical values in the contentclassattribute_id and from_contentobject_id columns. I have not yet found any documentation to indicate whether or not that is intentional behavior, although I am almost certain it isn't. And then I came across this comment from Sébastien Morel at http://ez.no/developer/contribs/d...ypes/ezobjectrelationbrowse_datatype:
====== 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) You can fix extension and upload on ez.no ? ====== Although Sébastien is kind of vague about what the "bad record" was, the rest of the description seemed to match my problem. I tried his fix and it appears to work. I figured maybe you didn't see his comment over there in the ez contribs section so thought I'd let you know here so it can be addressed in the next update. I looked at the google code repository and confirmed that the bad line is still there in ezobjectrelationbrowsetype.php. I have a second issue with this extension. (I will create a new thread for it if you prefer.) One cannot both filter on an attribute and sort by an attribute when doing a fetch on object relation browse objects -- doing so causes this SQL error: "Query error (1052): Column 'contentclassattribute_id' in where clause is ambiguous." It appears that the problem is that the part of the query that deals with filtering by attribute doesn't qualify the table for that column. Aside from those problems this datatype is very useful, thanks. |
|
Member since: Posts: 3 |
Wednesday 04 August 2010 3:55:16 pm Bah, never mind about that second issue -- the query construction problem is in the eZ kernel's ezcontentobject.php's relatedObjects() function. I have eZ Systems looking into that issue.
|
You need to be logged in to post messages in the forums. New users may register here.