File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
app/code/Magento/Eav/Model/Entity/Attribute/Backend Expand file tree Collapse file tree 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)
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 }
You can’t perform that action at this time.
0 commit comments