[-] FO : fixed bug #PSCFV-4137

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17449 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vAugagneur
2012-09-21 08:36:31 +00:00
parent c5c2d7e142
commit f7ac3955e1
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -911,8 +911,13 @@ abstract class ObjectModelCore
public function validateController($htmlentities = true)
{
$errors = array();
$required_fields_database = (isset(self::$fieldsRequiredDatabase[get_class($this)])) ? self::$fieldsRequiredDatabase[get_class($this)] : array();
foreach ($this->def['fields'] as $field => $data)
{
// Check if field is required by user
if (in_array($field, $required_fields_database))
$data['required'] = true;
// Checking for required fields
if (isset($data['required']) && $data['required'] && ($value = Tools::getValue($field, $this->{$field})) == false && (string)$value != '0')
if (!$this->id || $field != 'passwd')
+2 -1
View File
@@ -538,7 +538,8 @@ class AuthControllerCore extends FrontController
else
{
$address->id_customer = (int)$customer->id;
if ((Configuration::get('PS_REGISTRATION_PROCESS_TYPE') || $this->ajax || Tools::isSubmit('submitGuestAccount')) && !$address->add())
$this->errors = array_unique(array_merge($this->errors, $address->validateController()));
if (!count($this->errors) && (Configuration::get('PS_REGISTRATION_PROCESS_TYPE') || $this->ajax || Tools::isSubmit('submitGuestAccount')) && !$address->add())
$this->errors[] = Tools::displayError('An error occurred while creating your address.');
else
{