// Fix bug with object model validation
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12666 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -792,7 +792,7 @@ abstract class ObjectModelCore
|
|||||||
|
|
||||||
// Checking for fields validity
|
// Checking for fields validity
|
||||||
// Hack for postcode required for country which does not have postcodes
|
// 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']))
|
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.');
|
$errors[] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is invalid.');
|
||||||
|
|||||||
Reference in New Issue
Block a user