simplemap icon indicating copy to clipboard operation
simplemap copied to clipboard

Type error when no location is set.

Open samhibberd opened this issue 2 years ago • 1 comments

If the map field is passed an array with empty string, rather than floats or null values, BaseLocation.php throws a TypeError:

Cannot assign string to property ether\simplemap\models\BaseLocation::$lat of type ?float

Although it won't validate shouldnt the Map field be able to handle a value like this: Screenshot 2023-09-29 at 11 49 56

Bit of normalization in the map fields normalizeValue() method should cover it, happy to submit a RR if easier?

https://github.com/ethercreative/simplemap/blob/c1a9347914ca949888ab088ed710477ab4beb75c/src/fields/MapField.php#L246

samhibberd avatar Sep 29 '23 10:09 samhibberd

Any thoughts on this one?

samhibberd avatar Nov 08 '23 13:11 samhibberd