Adrian Posted July 31, 2018 Share Posted July 31, 2018 Hi, Well, all we have this error when we take out State:name from Country Address Format. Is anyone that found how to resolve this ? To explain better: the error appear when the State:name is deleted from Locations/Country/Edit Contry/Address format and you try to add an new shipping address in your account or on checkout (when you add new shipping address). I tuck out the State:name because I have only one country activated that meant to be the default one. The error is: [PrestaShopException] Property Address->id_country is empty.at line 954 in file classes/ObjectModel.php 949. } 950. 951. $message = $this->validateField($field, $this->$field); 952. if ($message !== true) { 953. if ($die) { 954. throw new PrestaShopException($message); 955. } 956. return $error_return ? $message : false; 957. } 958. } 959. ObjectModelCore->validateFields - [line 272 - classes/ObjectModel.php] ObjectModelCore->getFields - [line 529 - classes/ObjectModel.php] ObjectModelCore->add - [line 174 - classes/Address.php] - [2 Arguments] AddressCore->add - [line 487 - classes/ObjectModel.php] - [2 Arguments] ObjectModelCore->save - [line 76 - classes/form/CustomerAddressPersister.php] CustomerAddressPersisterCore->save - [line 157 - classes/form/CustomerAddressForm.php] - [2 Arguments] CustomerAddressFormCore->submit - [line 111 - classes/checkout/CheckoutAddressesStep.php] CheckoutAddressesStepCore->handleRequest - [line 61 - classes/checkout/CheckoutProcess.php] - [1 Arguments] CheckoutProcessCore->handleRequest - [line 262 - controllers/front/OrderController.php] - [1 Arguments] OrderControllerCore->initContent - [line 255 - classes/controller/Controller.php] ControllerCore->run - [line 428 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 28 - index.php] Link to comment Share on other sites More sharing options...
kolmen Posted September 1, 2018 Share Posted September 1, 2018 up, do you fix this? Link to comment Share on other sites More sharing options...
Adrian Posted September 2, 2018 Author Share Posted September 2, 2018 No. no solution yet. I don't have time to look to prestashop core and nobody else seems to be bored by this issue. Link to comment Share on other sites More sharing options...
ksaan Posted September 2, 2018 Share Posted September 2, 2018 If this is indeed a bug, you can report it to prestashop developers by opening an issue on github so they can fix it in next version: https://github.com/PrestaShop/PrestaShop/issues/new/choose Link to comment Share on other sites More sharing options...
PrestaMake Posted September 23, 2018 Share Posted September 23, 2018 On 2/9/2018 at 8:49 AM, Adrian said: No. no solution yet. I don't have time to look to prestashop core and nobody else seems to be bored by this issue. Sorry if too late. Just add country name to your address format inside your country configuration. https://i.imgur.com/YrnZlMz.png Link to comment Share on other sites More sharing options...
Adrian Posted September 24, 2018 Author Share Posted September 24, 2018 Yes. I know that ... but I don't need this field because I have only one country and this is default one. Link to comment Share on other sites More sharing options...
PrestaMake Posted September 24, 2018 Share Posted September 24, 2018 7 hours ago, Adrian said: Yes. I know that ... but I don't need this field because I have only one country and this is default one. Inside classes/Address.php change this line: 'id_country' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), to this: 'id_country' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), also you can try to change to this (both should work): 'id_country' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => false), After that you can hide the country and you no longer should receive that error. Please let me know if it helped! If the problem persist please let me know the PS version you are using so I can help you. Regards! Link to comment Share on other sites More sharing options...
Wing Tip Posted September 27, 2018 Share Posted September 27, 2018 I have select default setting for the country and now working Link to comment Share on other sites More sharing options...
RubenMing Posted October 1, 2018 Share Posted October 1, 2018 Problem seems related with saving address and CustomerAddressPersister.php file. Found a solution that worked for me here hope that it helps. 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