File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
app/code/Magento/Eav/Model/Entity/Attribute/Backend Expand file tree Collapse file tree 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)
231231 $ attribute = $ this ->getAttribute ();
232232 $ attrCode = $ attribute ->getAttributeCode ();
233233 $ value = $ object ->getData ($ attrCode );
234+ $ label = $ attribute ->getFrontend ()->getLabel ();
234235
235236 if ($ attribute ->getIsVisible ()
236237 && $ attribute ->getIsRequired ()
237238 && $ attribute ->isValueEmpty ($ value )
238239 && $ attribute ->isValueEmpty ($ attribute ->getDefaultValue ())
239240 ) {
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 ));
241242 }
242243
243244 if ($ attribute ->getIsUnique ()
@@ -248,8 +249,7 @@ public function validate($object)
248249 }
249250
250251 if ($ attribute ->getIsUnique ()) {
251- if (!$ attribute ->getEntity ()->checkAttributeUniqueValue ($ attribute , $ object )) {
252- $ label = $ attribute ->getFrontend ()->getLabel ();
252+ if (!$ attribute ->getEntity ()->checkAttributeUniqueValue ($ attribute , $ object )) {
253253 throw new LocalizedException (__ ('The value of attribute "%1" must be unique ' , $ label ));
254254 }
255255 }
You can’t perform that action at this time.
0 commit comments