From 751a82712f48c01a4bf4a6f5ac3ee403b7472f4f Mon Sep 17 00:00:00 2001 From: Pieter Zandbergen Date: Mon, 4 Nov 2024 14:05:09 +0100 Subject: [PATCH] fix: Use field translator for product fields (issue #39277) Fixing issue #39277 --- .../Model/Resolver/Product/ProductFieldsSelector.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductFieldsSelector.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductFieldsSelector.php index ab9fed035cc35..89906a130bfd3 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductFieldsSelector.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductFieldsSelector.php @@ -52,8 +52,10 @@ public function getProductFieldsFromInfo(ResolveInfo $info, string $productNodeN if ($node->name->value !== $productNodeName) { continue; } - $queryFields = $this->attributesJoiner->getQueryFields($node, $info); - $fieldNames[] = $queryFields; + $queryFields = array_map(function (string $fieldName): string { + return $this->fieldTranslator->translate($fieldName); + }, $this->attributesJoiner->getQueryFields($node, $info)); + $fieldNames[] = $queryFields; } return array_merge(...$fieldNames);