Toeareg Posted November 15, 2012 Share Posted November 15, 2012 I already posted this problem here: http://www.prestashop.com/forums/topic/203286-ps-152-problem-with-account-authentication-new-account-only/ But since I didn't get any further respons from Benjamin or anyone else, I did some further research myself. I have downloaded the latest stable 1.5.2 version and installed it with the default database items for testing. Then I set: define('_PS_MODE_DEV_', true); And then without making any further changes I tried to register a new account with a date of birth set to august 3rd 2011. That resulted in this error: [PrestaShopException] Property Customer->birthday is not valid at line 790 in file classes/ObjectModel.php 784. 785. $message = $this->validateField($field, $this->$field); 786. if ($message !== true) 787. { 788. if ($die) 789. throw new PrestaShopException($message); 790. return $error_return ? $message : false; 791. } 792. } 793. 794. return true; ObjectModelCore->validateFields - [line 265 - classes/ObjectModel.php] - [0 Argument] ObjectModelCore->getFields - [line 465 - classes/ObjectModel.php] - [0 Argument] ObjectModelCore->add - [line 214 - classes/Customer.php] - [2 Arguments] CustomerCore->add - [line 409 - controllers/front/AuthController.php] - [0 Argument] AuthControllerCore->processSubmitAccount - [line 253 - controllers/front/AuthController.php] - [0 Argument] AuthControllerCore->postProcess - [line 159 - classes/controller/Controller.php] - [0 Argument] ControllerCore->run - [line 349 - classes/Dispatcher.php] - [0 Argument] DispatcherCore->dispatch - [line 29 - index.php] - [0 Argument] It's exactly the same behaviour on 2 different servers. Server A: - Apache/2 - PHP 5.2.17 - MySQL 5.0.67 Server B: - Apache/2 - PHP 5.3.17 - MySQL 5.0.91 Hope you can solve this. 1 Link to comment Share on other sites More sharing options...
Rolige Posted November 24, 2012 Share Posted November 24, 2012 I have the same problem when tried to register an customer with date 26 / december / 1982 it show the same error in back office and front office, Did you solve the problem? Link to comment Share on other sites More sharing options...
Toeareg Posted November 24, 2012 Author Share Posted November 24, 2012 No, still no solution here Link to comment Share on other sites More sharing options...
JurrJuna Posted November 29, 2012 Share Posted November 29, 2012 Same here. Only have error when date of birth is set 2003 or younger. Link to comment Share on other sites More sharing options...
Rolige Posted November 29, 2012 Share Posted November 29, 2012 I think all here are using development version, in 1.5.2 final version this not happen, but this problem is presented in development version. Link to comment Share on other sites More sharing options...
Toeareg Posted November 29, 2012 Author Share Posted November 29, 2012 Because Benjamin mentioned that this problem wasn't reproducable by him, I downloaded the PS software from this website again on november 19th and installed it on my test server on the 20th. This test setup has the exact same problem. So either the "final" version you are referring to is not the version in the link on the main page of this website, or a new final version has been posted after november 20th, or there is something else causing this problem. However, if you know for sure that this problem did occur in the development version but has been solved in the final version, there clearly must be one or more files that have been changed to fix this problem. So why not tell me where to look (which file & line number) so I can check if I am on the correct version. Just assuming we are all on development versions is not very helpfull at all. Link to comment Share on other sites More sharing options...
jurrjurr Posted November 29, 2012 Share Posted November 29, 2012 @SQS, I am using version 1.5.2. @Toareg, agree, I am not using dev versions. Link to comment Share on other sites More sharing options...
Rolige Posted November 30, 2012 Share Posted November 30, 2012 @SQS, I am using version 1.5.2. @Toareg, agree, I am not using dev versions. Is strange, im using 1.5.2 official and not have problem with date, but i tested development version 6 days ago and have same problem, im not sure if development version at day now have the error, maybe you can test it, you can download in https://github.com/PrestaShop/PrestaShop/tree/development Link to comment Share on other sites More sharing options...
cardnpaste Posted December 27, 2012 Share Posted December 27, 2012 I have the same problem. Just upgraded to 1.5.2 and this happened. I know previously by default, this field is not compulsory but i changed the template to make it compulsory. Could it be this reason and any idea what to do now? Link to comment Share on other sites More sharing options...
Rolige Posted December 27, 2012 Share Posted December 27, 2012 For now, please try to use from here: http://www.prestashop.com/en/download or wait for next release Link to comment Share on other sites More sharing options...
cardnpaste Posted December 31, 2012 Share Posted December 31, 2012 If I download the latest version, i will lose all my settings on the template rite? It's gonna be haywire. Any other solutions yet? Even the latest 1.5.3 version couldn't work.. Link to comment Share on other sites More sharing options...
Dask Posted January 12, 2013 Share Posted January 12, 2013 Someone was being a real genius there. Validate.php:493 Replace if ($birth_date[1] > date('Y') || $birth_date[2] > date('m') || $birth_date[3] > date('d')) { With if ($birth_date[1] > date('Y') && $birth_date[2] > date('m') && $birth_date[3] > date('d')) { Link to comment Share on other sites More sharing options...
Toeareg Posted January 13, 2013 Author Share Posted January 13, 2013 (edited) Thanks for trying to help, but that code line is not from version 1.5.2 which we are discussing here. In version 1.5.2 this function is used: public static function isBirthDate($date) { if (empty($date) || $date == '0000-00-00') return true; if (preg_match('/^([0-9]{4})-((0?[1-9])|(1[0-2]))-((0?[1-9])|([1-2][0-9])|(3[01]))( [0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $birth_date)) { if ($birth_date[1] >= date('Y') - 9) return false; return true; } return false; } Edited January 13, 2013 by Toeareg (see edit history) Link to comment Share on other sites More sharing options...
lupillus Posted January 13, 2013 Share Posted January 13, 2013 i sloved this by changing function dateYears() in tools.php, so now it is showing only allowed years for registration, like it was in previous versions of presta in classes/tools.php replace this one: public static function dateYears() { $tab = array(); for ($i = date('Y'); $i >= 1900; $i--) $tab[] = $i; return $tab; } with this one: public static function dateYears() { $tab = array(); for ($i = date('Y') - 10; $i >= 1900; $i--) $tab[] = $i; return $tab; } Link to comment Share on other sites More sharing options...
Toeareg Posted January 13, 2013 Author Share Posted January 13, 2013 That's an option too of course, and it looks like an elegant one even. Nevertheless I would be much happier with a solution for the problem than a quick fix to circomvent the problem-trigger. It bothers me that errors can result in a completely blank page. No clue whatsoever what has gone wrong. That's annoying and it simply shouldn't be happening! Link to comment Share on other sites More sharing options...
lupillus Posted January 13, 2013 Share Posted January 13, 2013 i agree with you, but i needed a quick fix Link to comment Share on other sites More sharing options...
Toeareg Posted January 13, 2013 Author Share Posted January 13, 2013 I did some further research and found some inconsistent behaviour it seems. First I changed the default for $die from true to false (ObjectModel.php line 776): public function validateFields($die = false, $error_return = false) Now I can register with an invalid birth date. It will accept that without problems. Then I log in and go to my account settings and try to change the date to another invalid date. Now I get a proper warning that the date is not valid!!! That is how the error handling should work: a message instead of a blank screen. Would be nice if someone with more knowledge of the structure of the software could help out with this. Link to comment Share on other sites More sharing options...
karimun Posted April 2, 2013 Share Posted April 2, 2013 PS v1.5.3 also have a look at authentification.tpl in my theme they forgot to add {$year} in the lines (2x) that generate the dropdown for years. so: <option value="" {if ($sl_year == $year)} selected="selected"{/if}>{$year} </option> becomes: <option value="{$year}" {if ($sl_year == $year)} selected="selected"{/if}>{$year} </option> Theme: "Trendy" from themeforest.com (its only one bug among many others..) 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