Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot assign null to property ether\simplemap\models\Map::$zoom of type int #381

Closed
pdaleramirez opened this issue Nov 13, 2023 · 1 comment
Labels

Comments

@pdaleramirez
Copy link

I encountered the $zoom type error after upgrading from Craft 3 to 4.
Cannot assign null to property ether\simplemap\models\Map::$zoom of type int

For a quick fix, you can add ? in the Map model.

public ?int $zoom = 15;

Screenshot 2023-11-13 at 7 58 46 AM

@lukasNo1
Copy link

I have the same problem after updating to craft 4. It only affects the entries where the map field was empty.

For a quick fix i just ran an SQL Query, the null check in the model would be good though.

UPDATE content
SET field_FIELDNAME = REPLACE(field_FIELDNAME, '"zoom":null', '"zoom":8')
WHERE field_field_FIELDNAME LIKE '%"zoom":null%';

@Tam Tam closed this as completed in 5de1d9a Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants