Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Type Error (critical) #12

Open
fvwanja opened this issue Oct 25, 2023 · 3 comments
Open

Type Error (critical) #12

fvwanja opened this issue Oct 25, 2023 · 3 comments

Comments

@fvwanja
Copy link

fvwanja commented Oct 25, 2023

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
Copy link
Contributor

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
Copy link
Author

fvwanja commented Oct 26, 2023

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
Copy link
Contributor

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?

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

No branches or pull requests

2 participants