[-] FO : fixed bug #PSCFV-9388 - newsletter is required error, showing two times
This commit is contained in:
@@ -977,11 +977,11 @@ abstract class ObjectModelCore
|
|||||||
// Checking for required fields
|
// Checking for required fields
|
||||||
if (isset($data['required']) && $data['required'] && ($value = Tools::getValue($field, $this->{$field})) == false && (string)$value != '0')
|
if (isset($data['required']) && $data['required'] && ($value = Tools::getValue($field, $this->{$field})) == false && (string)$value != '0')
|
||||||
if (!$this->id || $field != 'passwd')
|
if (!$this->id || $field != 'passwd')
|
||||||
$errors[] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is required.');
|
$errors[$field] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is required.');
|
||||||
|
|
||||||
// Checking for maximum fields sizes
|
// Checking for maximum fields sizes
|
||||||
if (isset($data['size']) && ($value = Tools::getValue($field, $this->{$field})) && Tools::strlen($value) > $data['size'])
|
if (isset($data['size']) && ($value = Tools::getValue($field, $this->{$field})) && Tools::strlen($value) > $data['size'])
|
||||||
$errors[] = sprintf(
|
$errors[$field] = sprintf(
|
||||||
Tools::displayError('%1$s is too long. Maximum length: %2$d'),
|
Tools::displayError('%1$s is too long. Maximum length: %2$d'),
|
||||||
self::displayFieldName($field, get_class($this), $htmlentities),
|
self::displayFieldName($field, get_class($this), $htmlentities),
|
||||||
$data['size']
|
$data['size']
|
||||||
@@ -992,7 +992,7 @@ abstract class ObjectModelCore
|
|||||||
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[$field] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is invalid.');
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (isset($data['copy_post']) && !$data['copy_post'])
|
if (isset($data['copy_post']) && !$data['copy_post'])
|
||||||
@@ -1136,7 +1136,7 @@ abstract class ObjectModelCore
|
|||||||
$value = Tools::getValue($field);
|
$value = Tools::getValue($field);
|
||||||
|
|
||||||
if (empty($value))
|
if (empty($value))
|
||||||
$errors[] = sprintf(Tools::displayError('The field %s is required.'), self::displayFieldName($field, get_class($this), $htmlentities));
|
$errors[$field] = sprintf(Tools::displayError('The field %s is required.'), self::displayFieldName($field, get_class($this), $htmlentities));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $errors;
|
return $errors;
|
||||||
|
|||||||
@@ -414,11 +414,11 @@ class AuthControllerCore extends FrontController
|
|||||||
|
|
||||||
if ($error_phone)
|
if ($error_phone)
|
||||||
$this->errors[] = Tools::displayError('You must register at least one phone number.');
|
$this->errors[] = Tools::displayError('You must register at least one phone number.');
|
||||||
|
|
||||||
$this->errors = array_unique(array_merge($this->errors, $customer->validateController()));
|
$this->errors = array_unique(array_merge($this->errors, $customer->validateController()));
|
||||||
|
|
||||||
// Check the requires fields which are settings in the BO
|
// Check the requires fields which are settings in the BO
|
||||||
$this->errors = array_merge($this->errors, $customer->validateFieldsRequiredDatabase());
|
$this->errors = $this->errors + $customer->validateFieldsRequiredDatabase();
|
||||||
|
|
||||||
if (!Configuration::get('PS_REGISTRATION_PROCESS_TYPE') && !$this->ajax && !Tools::isSubmit('submitGuestAccount'))
|
if (!Configuration::get('PS_REGISTRATION_PROCESS_TYPE') && !$this->ajax && !Tools::isSubmit('submitGuestAccount'))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user