From 8617785b5c9aa52d198bd6f91dca36adfa68cdf0 Mon Sep 17 00:00:00 2001 From: Vincent Marmiesse Date: Thu, 28 Mar 2019 11:08:10 +0100 Subject: [PATCH] Do not validate lenght and input rule if attribute value is required but empty --- app/code/Magento/Eav/Model/Attribute/Data/Text.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Eav/Model/Attribute/Data/Text.php b/app/code/Magento/Eav/Model/Attribute/Data/Text.php index c5167821fdfce..a6fa24c1eff04 100644 --- a/app/code/Magento/Eav/Model/Attribute/Data/Text.php +++ b/app/code/Magento/Eav/Model/Attribute/Data/Text.php @@ -75,6 +75,8 @@ public function validateValue($value) if (empty($value) && $value !== '0' && $attribute->getDefaultValue() === null) { $label = __($attribute->getStoreLabel()); $errors[] = __('"%1" is a required value.', $label); + + return $errors; } $validateLengthResult = $this->validateLength($attribute, $value);