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

Fields in main language always included on always available content

    Details

      Description

      In the REST API, the languages parameter to filter fields on a given language is not working as expect on the load content and load version resources. (not tested but most likely the same issue happens in the Public API)

      For content with the always available flag, the fields in the main language are always included.

      Steps to reproduce:

      1. Create a content with the always available flag in eng-GB (for instance a Folder)
      2. Translate it into French (or whatever)
      3. Run the following command

        curl -H 'Accept: application/vnd.ez.api.Content+json' -H 'Cookie: eZSESSID=t6tcfvvpr0g671bppaf9h7glk7' 'http://ez.loc/api/ezp/v2/content/objects/1?languages=fre-FR'
        

      it should only return the fields in fre-FR, it actually returns both eng-GB and fre-FR.
      It seems it's related to https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/Repository/ContentService.php#L377-L396

        Issue Links

          Activity

          Hide
          Bertrand Dunogier added a comment -

          I have talked with André Rømcke, and you might have to reproduce in platformUI the logic we have with the translation helper from the kernel (used by the ez_field_value twig helper): https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/Helper/TranslationHelper.php.

          Show
          Bertrand Dunogier added a comment - I have talked with André Rømcke , and you might have to reproduce in platformUI the logic we have with the translation helper from the kernel (used by the ez_field_value twig helper): https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/Helper/TranslationHelper.php .
          Hide
          André Rømcke added a comment - - edited

          To add some context; what might be needed here is to get always available language to behave as a second priority language (like is now the case in search service) as opposed to a field filter, which is what it currently is, so fixing this is larger effort/change then it might seem.

          But it should nevertheless be done at some point, so changing to story and moving this to backlog.

          Show
          André Rømcke added a comment - - edited To add some context; what might be needed here is to get always available language to behave as a second priority language (like is now the case in search service) as opposed to a field filter, which is what it currently is, so fixing this is larger effort/change then it might seem. But it should nevertheless be done at some point, so changing to story and moving this to backlog.
          Hide
          André Rømcke added a comment - - edited
          Show
          André Rømcke added a comment - - edited PR: https://github.com/ezsystems/ezpublish-kernel/pull/1515 (merged to master@f055ded ).
          Hide
          Rui Silva (Inactive) added a comment -

          Tested and approved by QA for master.

          Show
          Rui Silva (Inactive) added a comment - Tested and approved by QA for master.

            People

            • Assignee:
              Unassigned
              Reporter:
              Damien Pobel (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: