[-] BugFix : If a field is empty don't validate this one
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9658 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -564,7 +564,7 @@ abstract class ObjectModelCore
|
||||
// Hack for postcode required for country which does not have postcodes
|
||||
if ($value = Tools::getValue($field, $this->{$field}) OR ($field == 'postcode' AND $value == '0'))
|
||||
{
|
||||
if (!Validate::$function($value))
|
||||
if (!Validate::$function($value) && (!empty($value) || in_array($field, $this->fieldsRequired)))
|
||||
$errors[] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is invalid.');
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user