// Fix bug with object model validation
This commit is contained in:
1 parent
912dee44d0
commit
67b805ad9a
1 file changed
+1
-1
@@ -792,7 +792,7 @@ abstract class ObjectModelCore
|
||||
|
||||
// Checking for fields validity
|
||||
// Hack for postcode required for country which does not have postcodes
|
||||
if ($value = Tools::getValue($field, $this->{$field}) || ($field == 'postcode' && $value == '0'))
|
||||
if (($value = Tools::getValue($field, $this->{$field})) || ($field == 'postcode' && $value == '0'))
|
||||
{
|
||||
if (isset($data['validate']) && !Validate::$data['validate']($value) && (!empty($value) || $data['required']))
|
||||
$errors[] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is invalid.');
|
||||
|
||||
Reference in new issue
Block a user