Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-27101

Getting MetaData of an object linked in 2 Object Relations within the same content




      There is a bug in eZ Publish Legacy regarding metaData sent to Solr when 2 relationList are added to the same class and same content added in both relation.

      Steps to reproduce :

      1. Create a class "Test" with a name and 2 object Relations "relation1" and "relation2".
      2. Create 2 articles "article1" and "article2"
      3. Create a content of that class "Test".
      4. In "relation1", add "article1"
      5. In "relation2", add "article1" and "article2".
      6. When publishing your content, have a look on metaData "attribute_relationN_t" returned by function eZRelationListType::metaData.
      • For "relation1", you will get "article1" metadata
      • For "relation2", as "article1" has been already parsed within "relation1", $GLOBALS["ez_content_object_recursion_protect"] contains "article1.id" and when testing "if ( eZContentObject::recursionProtect( $subObjectID ) )", it returns false and so, attributes of "article1" are not returned for metaData of "relation2".

      I think this test of recursionProtect is only there to avoid adding twice metadata of the same content within the same relation.
      In that case, it avoids also to add metaData of an already linked content within another relationList.

      Added by the Support Team

      This wrong behaviour can also be observed when using Legacy Search Engine, not necessarily only when using Solr.
      After publishing the Content of the class "Test" from the "Steps to reproduce", execute the following query on your database (change the contentobject_id to the one of the published Content):

      SELECT DISTINCT contentclass_attribute_id FROM ezpublish.ezsearch_object_word_link WHERE word_id = (SELECT id FROM ezpublish.ezsearch_word WHERE word = "article1") AND contentobject_id=100;

      There should be two results of this query (because "article1" should be linked to two different Content Attributes), but due to this bug, there will be only one result.


          Issue Links



              • Assignee:
                Flovntp Flo HUCK
              • Votes:
                0 Vote for this issue
                5 Start watching this issue


                • Created: