File tree 1 file changed +2
-1
lines changed
app/code/Magento/Eav/Model/Entity/Attribute/Backend
1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -231,13 +231,13 @@ public function validate($object)
231
231
$ attribute = $ this ->getAttribute ();
232
232
$ attrCode = $ attribute ->getAttributeCode ();
233
233
$ value = $ object ->getData ($ attrCode );
234
- $ label = $ attribute ->getFrontend ()->getLabel ();
235
234
236
235
if ($ attribute ->getIsVisible ()
237
236
&& $ attribute ->getIsRequired ()
238
237
&& $ attribute ->isValueEmpty ($ value )
239
238
&& $ attribute ->isValueEmpty ($ attribute ->getDefaultValue ())
240
239
) {
240
+ $ label = $ attribute ->getFrontend ()->getLabel ();
241
241
throw new LocalizedException (__ ('The value of attribute "%1" must be set ' , $ label ));
242
242
}
243
243
@@ -250,6 +250,7 @@ public function validate($object)
250
250
251
251
if ($ attribute ->getIsUnique ()) {
252
252
if (!$ attribute ->getEntity ()->checkAttributeUniqueValue ($ attribute , $ object )) {
253
+ $ label = $ attribute ->getFrontend ()->getLabel ();
253
254
throw new LocalizedException (__ ('The value of attribute "%1" must be unique ' , $ label ));
254
255
}
255
256
}
You can’t perform that action at this time.
0 commit comments