Fady S. Ghatas Posted December 29, 2019 Share Posted December 29, 2019 (edited) Hello, I've a problem after upgrading from Prestashop 1.7.1.1 to 1.7.6.2; I can't add new customers through the BO. I get this error message: "An unexpected error occurred. [PrestaShop\PrestaShop\Core\Domain\Customer\Exception\CustomerException code 0]" Steps to reproduce: Upgrade from 1.7.1 to 1.7.6 Go to the "Add New Customer" form in the backoffice. Fill all fields You will get the error message mentioned above. I've tried several solutions but none worked: Enable/Disable phone and phone_mobile in Customers>Addresses>Set required fields for this section. Add/Remove phone field in address format in Translations>Locations>[COUNTRY]>Address format. Debugging I tried to debug the problem further, so I've added var_dump in /src/Adapter/Customer/CommandHandler/AddCustomerHandler.php after assertRequiredFieldsAreNotMissing and got the following result; the form wants a value of 'phone': object(Customer)#4148 (61) { ... ["phone"]=> NULL ... ["fieldsRequired":protected]=> array(6) { [0]=> string(8) "lastname" [1]=> string(9) "firstname" [2]=> string(5) "email" [3]=> string(5) "phone" [4]=> string(6) "passwd" [5]=> string(8) "birthday" } ["fieldsSize":protected]=> array(7) { ["lastname"]=> int(255) ["firstname"]=> int(255) ["email"]=> int(128) ["phone"]=> int(32) ["passwd"]=> int(60) ["note"]=> int(65000) ["reset_password_token"]=> int(40) } ["fieldsValidate":protected]=> array(29) { ... ["phone"]=> string(13) "isPhoneNumber" ... } ["def":protected]=> array(4) { ["table"]=> string(8) "customer" ["primary"]=> string(11) "id_customer" ["fields"]=> array(33) { ... ["phone"]=> array(4) { ["type"]=> int(3) ["validate"]=> string(13) "isPhoneNumber" ["size"]=> int(32) ["required"]=> bool(true) } ... } ["classname"]=> string(8) "Customer" } ["update_fields":protected]=> NULL ["force_id"]=> bool(false) } Also, when I tried to debug the CustomerException, I got that the form has invalid field values. Any suggestions? Thank you Edited December 30, 2019 by Fady S. Ghatas (see edit history) Link to comment Share on other sites More sharing options...
Fady S. Ghatas Posted December 30, 2019 Author Share Posted December 30, 2019 (edited) On 12/30/2019 at 1:17 AM, luishuaymana said: Deleted I've tried both methods, 1-Click upgrade and the manual method! Both gave the same results. Before upgrading to 1.7.6, we had the phone field visible in the "Add New Customer" form, which is ideally what we want to achieve. But for now, we just need to get this form to work and then we can add the phone field later. Hope this clarifies the problem a bit more. Edited December 31, 2019 by Fady S. Ghatas (see edit history) Link to comment Share on other sites More sharing options...
Fady S. Ghatas Posted December 30, 2019 Author Share Posted December 30, 2019 (edited) It seems the Customer.php was overridden with an extra "phone" column definition, removing the `required` attribute worked. Edited December 30, 2019 by Fady S. Ghatas (see edit history) 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