PSITM Posted October 29, 2016 Share Posted October 29, 2016 (edited) Hi. When new customer click on register after enter first name, last name, email and pass see a Server Error 500. If smarty cache disabled its working ! after enable smarty cache error shown again. In DEV mode below message seen [PrestaShopException] Property Customer->firstname is not valid at line 909 in file classes/ObjectModel.php 904. } 905. 906. $message = $this->validateField($field, $this->$field); 907. if ($message !== true) { 908. if ($die) { 909. throw new PrestaShopException($message); 910. } 911. return $error_return ? $message : false; 912. } 913. } 914. ObjectModelCore->validateFields - [line 246 - classes/ObjectModel.php] ObjectModelCore->getFields - [line 487 - classes/ObjectModel.php] ObjectModelCore->add - [line 240 - classes/Customer.php] - [2 Arguments] CustomerCore->add - [line 458 - controllers/front/AuthController.php] AuthControllerCore->processSubmitAccount - [line 256 - controllers/front/AuthController.php] AuthControllerCore->postProcess - [line 178 - classes/controller/Controller.php] ControllerCore->run - [line 339 - override/classes/Dispatcher.php] Dispatcher->dispatch_16 - [line 107 - override/classes/Dispatcher.php] Dispatcher->dispatch - [line 28 - index.php] Please help me to solve it. Edited October 29, 2016 by PSITM (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted October 30, 2016 Share Posted October 30, 2016 That error occurs if the first name contains any of the following characters: 0-9!<>,;?=+()@#"°{}_$%: Does the first name contain any of those characters or anything other unusual characters that may cause a validation error? Another thing you can try is making sure the first name is not empty. If the name of the first name field doesn't match what the controller is expecting, you'll end up with an empty first name. Link to comment Share on other sites More sharing options...
PSITM Posted October 30, 2016 Author Share Posted October 30, 2016 (edited) That error occurs if the first name contains any of the following characters: 0-9!<>,;?=+()@#"°{}_$%: Does the first name contain any of those characters or anything other unusual characters that may cause a validation error? Another thing you can try is making sure the first name is not empty. If the name of the first name field doesn't match what the controller is expecting, you'll end up with an empty first name. First name not have any characters like 0-9!<>,;?=+()@#"°{}_$%:, and not empty. Edited October 30, 2016 by PSITM (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted October 30, 2016 Share Posted October 30, 2016 There must be something wrong. It's the following on lines 410-413 (on my PrestaShop v1.6.1.8 test site) of controllers/front/AuthController.php that get the first and last name: $lastnameAddress = Tools::getValue('lastname'); $firstnameAddress = Tools::getValue('firstname'); $_POST['lastname'] = Tools::getValue('customer_lastname', $lastnameAddress); $_POST['firstname'] = Tools::getValue('customer_firstname', $firstnameAddress); I suggest adding the following after that code to check the value: echo 'first name is: '.$_POST['firstname']; die; That should display the first name as it is received by the controller. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now