onyourmarks-agency / craft-geoaddress

Geo Address field for Craft 3 Sections.
MIT License
3 stars 5 forks source link

Type Error (critical) #12

Open fvwanja opened 1 year ago

fvwanja commented 1 year ago

When using the field I cannot save any entry due to this error:

tde\craft\geoaddress\services\GeoAddressService::getCoordsByAddress(): Argument #2 ($country) must be of type string, null given, called in path-to-project/app/vendor/tde/craftplugin-geoaddress/src/fields/GeoAddressField.php on line 72

Screenshot 2023-10-25 at 11 25 54

I am using a valid Google Maps key, which I entered in the plugin settings.

Craft 4.5.9 Plugin 2.0.0

jeffreyschmitz87 commented 1 year ago

Hi, is it possible you forgot to use step 5?

5. Copy and rename the file geoaddress-sample.php to [your craft directory]/config/geoaddress.php and modify it to include only those countries you want enabled.

fvwanja commented 1 year ago

Hello @jeffreyschmitz87 ,

thank you very much for your immediate reply 👍

I did not read step 5 as a requirement, more like „if you want to restrict the possible countries, do that”. Maybe you could clarify that in the README.

So I can now save entries with that field and I tested different adresses but none of them worked.

Screenshot 2023-10-26 at 10 22 58

The address that you see in the Screenshot is from a local movie theatre:

Name: Filmpalast Köln Address: Hohenzollernring 22 Zip: 50672 City: Köln

Link in Google Maps: https://maps.app.goo.gl/DF8KQhsGmcJAiLqo7

But none of my input generates coordinates. I did add a valid Google Maps API key in the plugin settings. I am running on HTTP. Any ideas?

Thanks again 🙏

jeffreyschmitz87 commented 1 year ago

I've just updated the README.md file which hopefully clarifies that step 5 is required. I've also just tested your address on one of our websites and the coordinates are being generated. Is it possible to switch to a HTTPS - environment and test it again?