Skip to content

ACF Taxonomy field does not return translated terms #44

Description

@ririshi

I have a homepage which has a pageHome ACF group. This group has an ACF group field called productCategories in the schema. This group field has a Taxonomy field, also called productCategories inside. The Taxonomy field correctly saves the translated Term IDs in the database, but when fetching the translated version of the homepage, both the original (Dutch) version and the translated (English) versions return Dutch taxonomy terms.

The below query is an example that should return the Dutch homepage and the English homepage, with taxonomy terms with different database IDs attached to each version.

query TestPageHome {
  page(id: "/", idType: URI) {
    ...PageHome
    translated {
      ...PageHome
    }
  }
}

fragment PageHome on Page {
  locale {
    locale
  }
  pageHome {
    productCategories {
      productCategories {
        databaseId
      }
    }
  }
}
{
  "data": {
    "page": {
      "locale": {
        "locale": "nl_NL"
      },
      "pageHome": {
        "productCategories": {
          "productCategories": [
            {
              "databaseId": 40
            },
            {
              "databaseId": 38
            },
            {
              "databaseId": 39
            }
          ]
        }
      },
      "translated": [
        {
          "locale": {
            "locale": "en_US"
          },
          "pageHome": {
            "productCategories": {
              "productCategories": [
                {
                  "databaseId": 40
                },
                {
                  "databaseId": 38
                },
                {
                  "databaseId": 39
                }
              ]
            }
          }
        }
      ]
    }
  }
}

Relevant plugins:

Plugin name Version
WPGraphQL 1.14
WPGraphQL for ACF 0.6.1
WPGraphQL WPML 1.1.0
ACFML 2.0.3
WPML CMS 4.6.0
WPML String Translation 3.2.4

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions