From efc74cd2616607defb736ad50779a995a2a81bae Mon Sep 17 00:00:00 2001 From: Alexander Menk Date: Thu, 22 Dec 2022 10:35:05 +0100 Subject: [PATCH 1/2] fix: #14495 Allow custom varchar attributes for customer grid * As described in the issue, it does not make sense to use the backend-type for the UI-component data type, because those do not exist necessarily * Changed it to frontend_input --- app/code/Magento/Customer/Ui/Component/Listing/Columns.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Ui/Component/Listing/Columns.php b/app/code/Magento/Customer/Ui/Component/Listing/Columns.php index 79602c031f2ec..5202ef1f479f7 100644 --- a/app/code/Magento/Customer/Ui/Component/Listing/Columns.php +++ b/app/code/Magento/Customer/Ui/Component/Listing/Columns.php @@ -171,7 +171,7 @@ public function updateColumn(array $attributeData, $newAttributeCode) $component->getData('config'), [ 'name' => $newAttributeCode, - 'dataType' => $attributeData[AttributeMetadata::BACKEND_TYPE], + 'dataType' => $attributeData[AttributeMetadata::FRONTEND_INPUT], 'visible' => (bool)$attributeData[AttributeMetadata::IS_VISIBLE_IN_GRID] ] ); From 793a9fc3728cf33f37bb6ba11fae146aa8a146ea Mon Sep 17 00:00:00 2001 From: Alexander Menk Date: Sun, 25 Dec 2022 12:42:12 +0100 Subject: [PATCH 2/2] fix: #14495 Adapt test to expect frontendInput --- .../Customer/Test/Unit/Ui/Component/Listing/ColumnsTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/ColumnsTest.php b/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/ColumnsTest.php index 3be200bdf90be..b922a52478dc8 100644 --- a/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/ColumnsTest.php +++ b/app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/ColumnsTest.php @@ -160,7 +160,7 @@ public function testPrepareWithAddColumn(): void public function testPrepareWithUpdateColumn(): void { $attributeCode = 'billing_attribute_code'; - $backendType = 'backend-type'; + $frontendInput = 'text'; $attributeData = [ 'attribute_code' => 'billing_attribute_code', 'frontend_input' => 'text', @@ -211,7 +211,7 @@ public function testPrepareWithUpdateColumn(): void 'config', [ 'name' => $attributeCode, - 'dataType' => $backendType, + 'dataType' => $frontendInput, 'filter' => [ 'filterType' => 'text', 'conditionType' => 'like',