This repository was archived by the owner on Apr 29, 2019. It is now read-only.
File tree 1 file changed +3
-3
lines changed
app/code/Magento/Eav/Model/Entity/Attribute/Backend 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -231,13 +231,14 @@ 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 ();
234
235
235
236
if ($ attribute ->getIsVisible ()
236
237
&& $ attribute ->getIsRequired ()
237
238
&& $ attribute ->isValueEmpty ($ value )
238
239
&& $ attribute ->isValueEmpty ($ attribute ->getDefaultValue ())
239
240
) {
240
- throw new LocalizedException (__ ('The value of attribute "%1" must be set ' , $ attrCode ));
241
+ throw new LocalizedException (__ ('The value of attribute "%1" must be set ' , $ label ));
241
242
}
242
243
243
244
if ($ attribute ->getIsUnique ()
@@ -248,8 +249,7 @@ public function validate($object)
248
249
}
249
250
250
251
if ($ attribute ->getIsUnique ()) {
251
- if (!$ attribute ->getEntity ()->checkAttributeUniqueValue ($ attribute , $ object )) {
252
- $ label = $ attribute ->getFrontend ()->getLabel ();
252
+ if (!$ attribute ->getEntity ()->checkAttributeUniqueValue ($ attribute , $ object )) {
253
253
throw new LocalizedException (__ ('The value of attribute "%1" must be unique ' , $ label ));
254
254
}
255
255
}
You can’t perform that action at this time.
0 commit comments