simplemap icon indicating copy to clipboard operation
simplemap copied to clipboard

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

Open pdaleramirez opened this issue 2 years ago • 1 comments

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

pdaleramirez avatar Nov 13 '23 00:11 pdaleramirez

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%';

lukasNo1 avatar Feb 27 '24 10:02 lukasNo1