From a620a8f2223cfe033ac670c538c6619afb5f19c1 Mon Sep 17 00:00:00 2001 From: Vu Van Tu Date: Mon, 26 Oct 2020 10:06:04 +0700 Subject: [PATCH 1/2] update input filter field --- .../FilterArgument/EntityAttributesForAst.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Model/Resolver/Brands/FilterArgument/EntityAttributesForAst.php b/Model/Resolver/Brands/FilterArgument/EntityAttributesForAst.php index fc3e7b0..db5cc90 100644 --- a/Model/Resolver/Brands/FilterArgument/EntityAttributesForAst.php +++ b/Model/Resolver/Brands/FilterArgument/EntityAttributesForAst.php @@ -23,6 +23,7 @@ namespace Mageplaza\ShopbybrandGraphQl\Model\Resolver\Brands\FilterArgument; use Magento\Framework\GraphQl\Query\Resolver\Argument\FieldEntityAttributesInterface; +use Mageplaza\Shopbybrand\Helper\Data; /** * Class EntityAttributesForAst @@ -41,14 +42,22 @@ class EntityAttributesForAst implements FieldEntityAttributesInterface 'tdv.value', 'tdv.default_value' ]; + /** + * @var Data + */ + protected $helperData; /** * EntityAttributesForAst constructor. * + * @param Data $helperData * @param array $additionalAttributes */ - public function __construct(array $additionalAttributes = []) - { + public function __construct( + Data $helperData, + array $additionalAttributes = [] + ) { + $this->helperData = $helperData; $this->additionalAttributes = array_merge($this->additionalAttributes, $additionalAttributes); } @@ -62,6 +71,10 @@ public function getEntityAttributes(): array $fields[$attribute] = 'String'; } + if ($this->helperData->versionCompare('2.3.4')) { + return $fields; + } + return array_keys($fields); } } From 3194abccf49a9f6115bfdf27a8ed446253e6631f Mon Sep 17 00:00:00 2001 From: jacker Date: Mon, 26 Oct 2020 11:37:35 +0700 Subject: [PATCH 2/2] Update composer version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 36c2e35..2780cc1 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "mageplaza/magento-2-shop-by-brand-graphql", "description": "Magento 2 Shop By Brand GraphQl Extension", "type": "magento2-module", - "version": "1.0.0", + "version": "1.0.1", "license": "proprietary", "authors": [ {