Closed adrianbj closed 5 months ago
@adrianbj @ryancramerdesign same issue, I am also wondering why the decimal places are limited to 4 anyway?
@cb2004 - strange thing is that I can't seem to reproduce this anymore. I've tried googling to see if more recent versions of PHP8 have relaxed this or not, but haven't found anything yet.
Testing via Tracy I see this, so it's like it doesn't care about it being a string anymore - I'm confused :)
I got the same error now.
My PHP version is 8.0.14 ProcessWire version is 3.0.192 Map Marker is 2.0.9
Going back to PHP 7.4.27 solves the issue. Do you need any additional info regarding the bug?
Changing the code to explicitly cast the values worked for me:
$lat = (float) $input["_{$name}_lat"];
$lng = (float) $input["_{$name}_lng"];
$precision = 4;
$this->defaultLat = (float) $this->defaultLat;
$this->defaultLng = (float) $this->defaultLng;
if( ((string) round($lat, $precision)) != ((string) round($this->defaultLat, $precision)) ||
Thanks, I've pushed an update that uses @craigrodway suggestion and also updated the module to be PW 3.x native. Though haven't been able to test properly as my previous maps API keys don't seem to work anymore and Google is asking me for money to get a new key. Can anyone with a key confirm that this update fixes the issue?
@ryancramerdesign the issue seemed to just disappear for me if I remember correctly. With the API, you just supply credit card details and it will only charge if you go over the free uses per month (which is quite a lot).
It's impossible to save a page with a MM field in PHP 8 because of this error: