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...
wepresta Posted December 29, 2025 Share Posted December 29, 2025 (edited) Hi, This is not a configuration issue , it’s a bug in PrestaShop 9.0.2. Your screenshot shows this error: AddStateCommand::__construct(): Argument #1 ($countryId) must be of type int, string given So when you save a State, the form sends country_id as a string, but the command expects an int, and the back office crashes. The real fix : Update PrestaShop to the latest 9.0.x patch (9.0.3 / 9.0.4+). This issue is typically fixed in a patch release. Quick workaround (if you can’t update right now) Patch the core to cast the country id to int in: src/Core/Form/IdentifiableObject/DataHandler/StateFormDataHandler.php Before creating the command, cast it: $countryId = (int) $data['country_id']; Then use $countryId when building AddStateCommand. Note: this is a core change and will be overwritten by the next update, so upgrading is the clean solution. Edited December 29, 2025 by wepresta (see edit history) Link to comment Share on other sites More sharing options...
balaomais Posted December 29, 2025 Author Share Posted December 29, 2025 Thanks for the help 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