Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACF Taxonomy field does not return translated terms #44

Open
Ririshi opened this issue Apr 26, 2023 · 0 comments
Open

ACF Taxonomy field does not return translated terms #44

Ririshi opened this issue Apr 26, 2023 · 0 comments

Comments

@Ririshi
Copy link

Ririshi commented Apr 26, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant