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

While indexing multilingual objects relation, a wrong language is indexed

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 4.4.0beta2
    • 4.1.4, 4.2.0, 4.3.0, 4.4.0alpha3
    • Language, Search
    • None

    Description

      When we create an object with a relation to a multilingual object, the related object's content is sometimes indexed in a wrong language.
      I think it's because of the metaData() function of eZObjectRelationListType class, who doesn't consider the language of the relationlist attribute to get data from the related object
      (eZ 4.1 : kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php:1469
      eZ 4.3 : kernel/classes/datatypes/ezobjectrelationlist/ezobjectrelationlisttype.php:1504 )

      We should just add the attribute's language to get the related object's metadata :

      $attributes = $object->contentObjectAttributes( true, $subObjectVersion );
      

      =>

      $attributes = $object->contentObjectAttributes( true, $subObjectVersion, $contentObjectAttribute->attribute( 'language_code' )  );
      
      Steps to reproduce

      1. create an object (named *Object 1* ) in French.
      2. create an English version of *Object 1*
      3. create a new object (named *Object 2) in English, with a relation to **Object 1* (with an //ezobjectrelationlist// attribute)
      4. Index *Object 2* in eZ Find

      => the French content of *Object 1* will be indexed within *Object 2* content in solr (we should have the English content)

      Attachments

        Activity

          People

            pborgerm pborgerm
            ballinette ballinette
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: