balaomais Posted December 26, 2025 Share Posted December 26, 2025 In a fresh 9.02 installation, I can't add or change any states. When I try to save, I get an error. Can anyone help? Link to comment Share on other sites More sharing options...
El Patron Posted January 5 Share Posted January 5 Temporary workaround (if you cannot upgrade immediately) This is a known bug in PrestaShop 9.0.2, not a configuration issue. The back office State form sends country_id as a string, but the core command expects an integer, which causes the fatal error when adding or editing states. You can apply a temporary core patch until you upgrade. o File to edit: /src/Core/Form/IdentifiableObject/DataHandler/StateFormDataHandler.php o Find the code that creates AddStateCommand (or EditStateCommand), similar to: new AddStateCommand( $data['country_id'], $data['iso_code'], $data['name'], $data['enabled'] ); o Fix by casting country_id to int: $countryId = (int) $data['country_id']; new AddStateCommand( $countryId, $data['iso_code'], $data['name'], $data['enabled'] ); o Clear cache after the change: Advanced Parameters → Performance → Clear cache (or delete /var/cache/*) 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