File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
app/code/Magento/Store/Model/Validation Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ public function isValid($value)
41
41
),
42
42
\Zend_Validate_Regex::NOT_MATCH
43
43
);
44
+ $ result = $ validator ->isValid ($ value );
45
+ $ this ->_messages = $ validator ->getMessages ();
44
46
45
- return $ validator -> isValid ( $ value ) ;
47
+ return $ result ;
46
48
}
47
49
}
Original file line number Diff line number Diff line change @@ -34,8 +34,13 @@ public function __construct(NotEmptyFactory $notEmptyValidatorFactory)
34
34
public function isValid ($ value )
35
35
{
36
36
$ validator = $ this ->notEmptyValidatorFactory ->create (['options ' => []]);
37
- $ validator ->setMessage (__ ('Name is required ' ), \Zend_Validate_NotEmpty::IS_EMPTY );
37
+ $ validator ->setMessage (
38
+ __ ('Name is required ' ),
39
+ \Zend_Validate_NotEmpty::IS_EMPTY
40
+ );
41
+ $ result = $ validator ->isValid ($ value );
42
+ $ this ->_messages = $ validator ->getMessages ();
38
43
39
- return $ validator -> isValid ( $ value ) ;
44
+ return $ result ;
40
45
}
41
46
}
Original file line number Diff line number Diff line change @@ -44,7 +44,9 @@ public function isValid($value)
44
44
foreach ($ this ->rules as $ fieldName => $ rule ) {
45
45
$ validator ->addRule ($ rule , $ fieldName );
46
46
}
47
+ $ result = $ validator ->isValid ($ value );
48
+ $ this ->_messages = $ validator ->getMessages ();
47
49
48
- return $ validator -> isValid ( $ value ) ;
50
+ return $ result ;
49
51
}
50
52
}
You can’t perform that action at this time.
0 commit comments