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
.png.022b5452a8f28f552bc9430097a16da2.png)