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

Selection fieldtype translation is not taken into account when using GraphQL

    XMLWordPrintable

Details

    Description

      When querying for Content using GraphQL the translated value of ezselection fieldtype in Content is not returned, the main translation is returned instead.

      Steps to reproduce:
      1. Login as admin
      2. Add new Language: French (fre-FR). Add it as a language in admin_group (in ezplatform.yml)
      3. Add new siteaccess: fre. In ezplatform.yml:

          system:
              fre:
                  languages: [fre-FR, eng-GB]
              site:
                  languages: [eng-GB]
              site_group:
      #          languages
      

      Add it to to site_group, page builder siteaccesses etc.
      4. Create new Content Type: SelectionCT
      5. Add fieldtype: ezselection
      6. Add an option: "Option1"
      7. Publish Content Type and a french translation of it:
      translate "Option1" to "Option1French".
      8. Create a new Content Item based on created Content Type (in English). Select "Option1"
      9. Translate the created item to French. Select "Option1French"
      10. Regenerate GraphQL schema to take new CT into account:
      php bin/console ezplatform:graphql:generate-schema and clear cache.
      11. Go to yousite.com/fre/login and login as admin
      12. Go to: yoursite.com/fre/graphiql and query:

      {
        content {
          selection(locationId:CONTENT_LOCATION_ID){
            newEzselection1
          }
        }
      }
      

      Expected:

      {
        "data": {
          "content": {
            "selection": {
              "newEzselection1": "Option1French"
            }
          }
        }
      }
      

      Actual:

      {
        "data": {
          "content": {
            "selection": {
              "newEzselection1": "Option1"
            }
          }
        }
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            marek.nocon@ibexa.co Marek NocoĊ„
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: