stnadmin Posted September 24, 2013 Share Posted September 24, 2013 I need help figuring out an issue that I may have introduced but I still need to figure out how to fix it. I have a site that is a multi-store and I have enabled the advanced-stock management. Now when I try to go add a new warehouse I get this error: 2 errors company is required. The address is not correct. Please make sure all of the required fields are completed. So now I'm trying to figure out why it is requiring company and company isn't even a field on the new Warehouse form. TIA, Don Link to comment Share on other sites More sharing options...
krisives Posted September 24, 2013 Share Posted September 24, 2013 Don, This issue might have been logged in the issue database, but there are quite a few problems with adding Warehouses in general so I won't list those ticket numbers since it's not clear which is which (go to forge.prestashop.com and browse issues then search for "Warehouse Company") I took a peek at the code for AdminWarehouseController and AdminAddressController and the issue is because company is an "optional" field that isn't supported well between the two. I believe it's required in the context of an address, but optional in the context of the company. My first workaround attempted to just disregard the error message from the AdminAddressController, but that blows up in your face because the underlying address model will eventually throw an error as it constantly expects company to be populated. The easiest workaround until the two controllers play better is to simply hard code a dummy company to make everything happy, which is what I did for the time being: Around line #523 in AdminWarehousesController.php you can add this line: $address->id_state = Tools::getValue('id_state', null); $address->city = Tools::getValue('city', null); $address->company = 'Dummy'; // FIXME fix warehouse not saving bug Here is the GitHub source that appears to be the same in current development: https://github.com/PrestaShop/PrestaShop/blob/development/controllers/admin/AdminAddressesController.php#L167 https://github.com/PrestaShop/PrestaShop/blob/development/controllers/admin/AdminWarehousesController.php 2 Link to comment Share on other sites More sharing options...
johnlema Posted July 29, 2014 Share Posted July 29, 2014 On 9/24/2013 at 8:33 PM, stnadmin said: I need help figuring out an issue that I may have introduced but I still need to figure out how to fix it. I have a site that is a multi-store and I have enabled the advanced-stock management. Now when I try to go add a new warehouse I get this error: 2 errors company is required. The address is not correct. Please make sure all of the required fields are completed. So now I'm trying to figure out why it is requiring company and company isn't even a field on the new Warehouse form. TIA, Don Some one can help us, I have a same problem please.......... 1 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