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

Type error when no location is set. #379

Closed
samhibberd opened this issue Sep 29, 2023 · 1 comment · Fixed by #384
Closed

Type error when no location is set. #379

samhibberd opened this issue Sep 29, 2023 · 1 comment · Fixed by #384
Labels

Comments

@samhibberd
Copy link
Contributor

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?

$map = new Map($value);

@samhibberd
Copy link
Contributor Author

Any thoughts on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant