In a Magento 2.2.5 installation we are currently having the problem that we cannot change the country of a customer - who was imported from a Magento 1.x installation.

The customer is assigned to a store where the countries AT and DE are enabled. The customer got the wrong country in his one and only address and thus we want to change it from AT (Austria) to DE (Germany). These are the only choices due to the store configuration. However, when we click on "Save Customer", we are not redirected back to the customer list. Instead we are redirected to the customer edit view again.

There is no error message or anything else. When we go back to the list, we can see that the country did not actually change. We can edit everything else in the customer's address (like name, region, zip code etc.). But changing the country from AT to DE is impossible.

Since the click on "Save Customer" actually redirects back to the edit view instead of the list view, I assume that Magento actually recognized that something went wrong and the edited information is not saved. However, there is no visible error message.

What could be the problem? How could we find out why Magento cannot save the changed country of the customer's address?


There is actually an error message:

[2018-09-18 09:11:21] main.CRITICAL: Invalid value of "DE" provided for the countryId field. {"exception":"[object] (Magento\Framework\Exception\InputException(code: 0): Invalid value of "DE" provided for the countryId field. at /home/myproabr/www.myproduct.at/shop/vendor/magento/module-customer/Model/ResourceModel/AddressRepository.php:129)"} []

But how can this be? "AT" and "DE" should be valid country IDs. They are also the only options provided in the select, due to the store configuration of the customer's store.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.