From 2b46c8a3515525842d7ab1a85269960679a49714 Mon Sep 17 00:00:00 2001 From: Theis Corfixen Date: Tue, 6 Dec 2016 16:10:42 +0200 Subject: [PATCH 1/2] Allows you to have 0 as a option Corrects validation of options, to allow you to have 0 as a value (cherry picked from commit f2c66b6) --- app/code/Magento/Swatches/Model/Plugin/EavAttribute.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php b/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php index 46bafbc418fb1..daca1a16e7408 100644 --- a/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php +++ b/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php @@ -430,7 +430,7 @@ protected function isOptionsValid(array $options, Attribute $attribute) if ($this->isOptionForDelete($attribute, $optionId)) { continue; } - if (empty($option[0])) { + if ($option[0] === '') { return false; } } From bc8877a0d2ea0d9422e014a30a6f286a63515616 Mon Sep 17 00:00:00 2001 From: Theis Corfixen Date: Wed, 7 Dec 2016 13:01:57 +0200 Subject: [PATCH 2/2] Update EavAttribute.php (cherry picked from commit c5cddd9) --- app/code/Magento/Swatches/Model/Plugin/EavAttribute.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php b/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php index daca1a16e7408..ed6f7ec18cf08 100644 --- a/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php +++ b/app/code/Magento/Swatches/Model/Plugin/EavAttribute.php @@ -430,7 +430,7 @@ protected function isOptionsValid(array $options, Attribute $attribute) if ($this->isOptionForDelete($attribute, $optionId)) { continue; } - if ($option[0] === '') { + if (!isset($option[0]) || $option[0] === '') { return false; } }