Skip to content

Commit d248f4e

Browse files
Oleksii Korshenkoishakhsuvarov
Oleksii Korshenko
authored andcommitted
MAGETWO-84272: Update AbstractBackend.php #12120
- fixed failed tests
1 parent 5d084ce commit d248f4e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/code/Magento/Eav/Model/Entity/Attribute/Backend/AbstractBackend.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,13 @@ public function validate($object)
231231
$attribute = $this->getAttribute();
232232
$attrCode = $attribute->getAttributeCode();
233233
$value = $object->getData($attrCode);
234-
$label = $attribute->getFrontend()->getLabel();
235234

236235
if ($attribute->getIsVisible()
237236
&& $attribute->getIsRequired()
238237
&& $attribute->isValueEmpty($value)
239238
&& $attribute->isValueEmpty($attribute->getDefaultValue())
240239
) {
240+
$label = $attribute->getFrontend()->getLabel();
241241
throw new LocalizedException(__('The value of attribute "%1" must be set', $label));
242242
}
243243

@@ -250,6 +250,7 @@ public function validate($object)
250250

251251
if ($attribute->getIsUnique()) {
252252
if (!$attribute->getEntity()->checkAttributeUniqueValue($attribute, $object)) {
253+
$label = $attribute->getFrontend()->getLabel();
253254
throw new LocalizedException(__('The value of attribute "%1" must be unique', $label));
254255
}
255256
}

0 commit comments

Comments
 (0)