proudcity / wp-proudcity

The ProudCity WordPress platform
https://proudcity.com
Other
21 stars 9 forks source link

Google map key in event location issue #2553

Closed kevindherman closed 2 weeks ago

kevindherman commented 1 month ago

Source

Platform except City Template Zendesk tickets:

  1. SR https://proudcity.zendesk.com/agent/tickets/6967
  2. Petaluma (few things in this one) https://proudcity.zendesk.com/agent/tickets/6931

Describe the bug

Event locations are displaying google map location not found error on all locations. It drops a pin on the front-end after people select "directions" button. However, it gives an alert on the back-end saying location not found that makes it seem like it's not working at all.

To reproduce

Steps to reproduce the behavior:

  1. Go to any event
  2. Click on edit
  3. Scroll down to location information
  4. See error

https://www.somervillenj.org/wp-admin/post.php?post=7637&action=edit Screen Shot 2024-05-21 at 12 25 41 PM

Expected behavior

It is working correctly on City Template, see: https://demo.proudcity.com/wp-admin/post.php?post=4676&action=edit] Screen Shot 2024-05-21 at 12 29 53 PM

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

@curtismchale I wonder if adding the google maps key as referenced in this issue to City Template has thrown things off for everyone else: https://github.com/proudcity/wp-proudcity/issues/2384

Also we should delete this test from city template once @curtismchale has tested.

QA

Notes:

Links:

*

kevindherman commented 1 month ago

@curtismchale I see that the google map API browser key is empty in the updated version of events manager:

https://cityofpetaluma.org/wp-admin/edit.php?post_type=event&page=events-manager-options# Screen Shot 2024-05-22 at 3 56 51 PM

curtismchale commented 3 weeks ago

@kevindherman I've found the problem and submitted a support ticket. Ultimately there are no values for location_latitude and location_longitude for some older locations.

This can be fixed manually by going to the location and putting in any other address (to get the system to update the map) then changing it back to the address we want. It only needs to be done on the first line of the location. Once this is done the map should load and then we can save the location.

I'm going to take a bit to see if there is a way to loop through the locations and find the ones with no values for lat/long and then generate them.

kevindherman commented 3 weeks ago

@curtismchale super helpful. Would be really great if there was a way to resolve without the manual approach but good to know there is an option for the timebeing.

Random: Do you think the address issue could create a delay in auto-draft or publishing? Or is that completely unrelated?

curtismchale commented 3 weeks ago

@kevindherman I think it's unlikely that they're related.

kevindherman commented 3 weeks ago

@curtismchale are you able to do what you outlined for these event locations because I'm not having success:

  1. https://cityofpetaluma.org/wp-admin/post.php?post=15083&action=edit
  2. https://www.cityofsanrafael.org/wp-admin/post.php?post=89431&action=edit
curtismchale commented 3 weeks ago

@kevindherman both done. The API wasn't added under Event Settings and neither of the sites had their URL allowed for the API key so no API calls were going through.

I've fixed both of those locations and I'm still working on a proper fix for getting all locations and adding the lat/long information. I'd anticipate a custom plugin that would take 5 - 10 hours to build/test/deploy and run on all sites.

kevindherman commented 3 weeks ago

Very helpful. @curtismchale

Since this is a platform issue we may need to jump on it. Having said that, the new API is a way for them to track traffic and bill us.

Without the API key, the get directions button for the user drops a pin at the location. So it works, just doesn't embed the map and looks crappy for the editor who gets a message that makes it seem broken.

Lets talk through if it's worth the time and money for the embed vs just getting rid of the google maps error for admins.

kevindherman commented 3 weeks ago

@curtismchale in the interim, if I have other zendesk tickets about event locations, can I just add the same API key to their plugin settings and then direct them to update their location?

curtismchale commented 2 weeks ago

@kevindherman yes you can add the API key to their settings. They may also need to be added to the allowed domains for the API key here. Theoretically the domain is added as part of a site launch sequence but both of the sites in question were not added.

curtismchale commented 2 weeks ago

Deployed Builds: https://github.com/proudcity/proud-recipes/releases/tag/2024.06.13.1024 Composer: https://github.com/proudcity/wp-proudcity/releases/tag/2024.06.13.1024