simplemap
simplemap copied to clipboard
Cannot assign null to property ether\simplemap\models\Map::$zoom of type int
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;
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%';