europablue Posted January 5, 2016 Share Posted January 5, 2016 Hi, I've just installed version 1.6.1.3 on a new server and while I've succeeded in working through a few issues, this one is a little beyond me (so far). It occurs when I try to create a new customer account. I enter the email on page 1, then First Name, Last Name, email & password on page 2, click "Register" and get the following. I am running on PHP 7.0.1, with changes as listed at: https://github.com/PrestaShop/PrestaShop/pull/4503/files https://github.com/PrestaShop/PrestaShop/pull/4630/files Any thoughts? All assistance is much appreciated. - Joel [PrestaShopException]Property Customer->lastname is emptyat 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]241. * @return array All object fields242. * @throws PrestaShopException243. */244. public function getFields()245. {246. $this->validateFields();247. $fields = $this->formatFields(self::FORMAT_COMMON);248.249. // For retro compatibility250. if (Shop::isTableAssociated($this->def['table'])) {251. $fields = array_merge($fields, $this->getFieldsShop()); ObjectModelCore->getFields - [line 487 - classes/ObjectModel.php]482.483. // Database insertion484. if (Shop::checkIdShopDefault($this->def['table'])) {485. $this->id_shop_default = (in_array(Configuration::get('PS_SHOP_DEFAULT'), $id_shop_list) == true) ? Configuration::get('PS_SHOP_DEFAULT') : min($id_shop_list);486. }487. if (!$result = Db::getInstance()->insert($this->def['table'], $this->getFields(), $null_values)) {488. return false;489. }490.491. // Get object id in database492. $this->id = Db::getInstance()->Insert_ID(); ObjectModelCore->add - [line 229 - classes/Customer.php] - [2 Arguments]224.225. /* Can't create a guest customer, if this feature is disabled */226. if ($this->is_guest && !Configuration::get('PS_GUEST_CHECKOUT_ENABLED')) {227. return false;228. }229. $success = parent::add($autodate, $null_values);230. $this->updateGroup($this->groupBox);231. return $success;232. }233.234. public function update($nullValues = false) CustomerCore->add - [line 458 - controllers/front/AuthController.php]453. // New Guest customer454. $customer->is_guest = (Tools::isSubmit('is_new_customer') ? !Tools::getValue('is_new_customer', 1) : 0);455. $customer->active = 1;456.457. if (!count($this->errors)) {458. if ($customer->add()) {459. if (!$customer->is_guest) {460. if (!$this->sendConfirmationMail($customer)) {461. $this->errors[] = Tools::displayError('The email cannot be sent.');462. }463. } AuthControllerCore->processSubmitAccount - [line 256 - controllers/front/AuthController.php]251. if (Tools::isSubmit('SubmitCreate')) {252. $this->processSubmitCreate();253. }254.255. if (Tools::isSubmit('submitAccount') || Tools::isSubmit('submitGuestAccount')) {256. $this->processSubmitAccount();257. }258.259. if (Tools::isSubmit('SubmitLogin')) {260. $this->processSubmitLogin();261. } AuthControllerCore->postProcess - [line 178 - classes/controller/Controller.php]173. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {174. $this->setMedia();175. }176.177. // postProcess handles ajaxProcess178. $this->postProcess();179.180. if (!empty($this->redirect_after)) {181. $this->redirect();182. }183. ControllerCore->run - [line 367 - classes/Dispatcher.php]362. if (isset($params_hook_action_dispatcher)) {363. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);364. }365.366. // Running controller367. $controller->run();368. } catch (PrestaShopException $e) {369. $e->displayMessage();370. }371. }372. DispatcherCore->dispatch - [line 28 - index.php]23. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)24. * International Registered Trademark & Property of PrestaShop SA25. */26.27. require(dirname(__FILE__).'/config/config.inc.php');28. Dispatcher::getInstance()->dispatch(); Link to comment Share on other sites More sharing options...
europablue Posted January 5, 2016 Author Share Posted January 5, 2016 This error only occurs during customer account creation from the front office. Employee & customer creation is fine from the backoffice is fine. Link to comment Share on other sites More sharing options...
europablue Posted January 6, 2016 Author Share Posted January 6, 2016 I have now tested this with a fresh install of 1.6.1.3 on PHP 7.0.1 and no multistore this time. Same error. This appears to be where the problem occurs, where "field" = "lastname" and "$this->$field" is empty and does not validate. $message = $this->validateField($field, $this->$field); On both installations, if I set the Registration process type to "Standard (account creation with address creation)" I get the foll error: Country cannot be loaded with address->id_countryCountry is invalid Also, Without the patches at: https://github.com/PrestaShop/PrestaShop/pull/4503/files https://github.com/PrestaShop/PrestaShop/pull/4630/files The site crashes out with: PHP Fatal error: Uncaught Error:Access to undeclared static property: Validate::$data in /home/admin/web/domain.com/public_html/prestashop/classes/ObjectModel.php:1149Stack trace:#0 /home/admin/web/domain.com/public_html/prestashop/controllers/front/AuthController.php(437): ObjectModelCore->validateController()#1 /home/admin/web/domain.com/public_html/prestashop/controllers/front/AuthController.php(256): AuthControllerCore->processSubmitAccount()#2 /home/admin/web/domain.com/public_html/prestashop/classes/controller/Controller.php(178): AuthControllerCore->postProcess()#3 /home/admin/web/domain.com/public_html/prestashop/classes/Dispatcher.php(367): ControllerCore->run()#4 /home/admin/web/domain.com/public_html/prestashop/index.php(28): DispatcherCore->dispatch()#5 {main} thrown in /home/admin/web/domain.com/public_html/prestashop/classes/ObjectModel.php on line 1149, referer: http://domain.com/prestashop/login?back=my-account Link to comment Share on other sites More sharing options...
europablue Posted January 6, 2016 Author Share Posted January 6, 2016 Yes! All the account creation related errors I mentioned have been fixed by https://github.com/Shudrum/PrestaShop/commit/c243c8af08e94a1fd27f063e6ea2a30bd89c65f9 1 Link to comment Share on other sites More sharing options...
cometemarketing Posted May 31, 2019 Share Posted May 31, 2019 ok, ,changed my calsses/ObjectModel.php file with this one and i am still getting the same error : "• Property Customer->lastname is empty" i am using opc ps module on 1.6.1.24. i made some changes in order to remove some address things but i am %100 sure the i rolled back, so files are original ones but still getting the same error. it started when i placed one test order. after the test order tried to make new one with the option registration. can not resolve it now. deleted that test customer from db and still the same. 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