#42787 closed defect (bug) (invalid)
Location Search not working for same name cities in different states (Events & News dashboard widget)
Reported by: | shedonist | Owned by: | iandunn |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.8 |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
The Events & News widget in the admin dashboard only accepts a city name and ignores when you add a state. This means it picks a state for you and it may not be the state you want. This makes it extremely difficult to locate meetups in cities where different cities with the same name both have meetups.
For example, I run a meetup in Portsmouth, NH. When I search for "Portsmouth, NH" or "Portsmouth" the widget is showing results near Portsmouth, VA. When I search for "Boston", the Portsmouth, NH does show (so it is in there!). Similarly, if you search for "Portland, OR" or "Portland" you only see the meetups near Portland, ME (Portsmouth, NH and Westbrook, ME).
Attachments (2)
Change History (6)
#1
@
7 years ago
- Focuses administration removed
- Milestone changed from Awaiting Review to WordPress.org
- Owner set to iandunn
- Status changed from new to accepted
- Version changed from trunk to 4.8
Thanks for the report Amanda :)
To some extent this is a known limitation of the API, but there are some steps we already take to mitigate it, and there may be some more things we can do. Sometimes it's tough to balance those with performance implications, though.
#meta2823 has some related discussion about performance, and possibly about moving to Google's Geocoding API as an alternative (comment 51 has a recap of the latest status).
There may still be some incremental changes we can make to improve things with the current API, though.
Can you add some more details, so that we can isolate the exact cause? If you install the log-community-events-requests.php
mu-plugin from #41217, then you'll start seeing the details in your PHP error log when you search for a city.
( The changes to fix this are likely on the API side, but moving this to the w.org milestone for now, since it's not entirely clear yet )
#2
@
7 years ago
Thanks for the info, @iandunn. I installed the logger as requested.
When I search for "Portsmouth, NH", I get this:
[06-Dec-2017 23:00:12 UTC] debug_community_events_response: Valid response received. Details: {"request_url":"https:\/\/api.wordpress.org\/events\/1.0\/","request_args":{"number":5,"ip":"127.0.0.0","locale":"en_US","timezone":"America\/New_York","location":"Portsmouth, NH"},"response_code":200,"response_body":{"location":{"description":"Portsmouth","latitude":"36.8354300","longitude":"-76.2982700","country":"US"},"events":"4 events trimmed."}}
If I search for "Portsmouth", what I get seems to be identical except for the location field:
[06-Dec-2017 23:00:25 UTC] debug_community_events_response: Valid response received. Details: {"request_url":"https:\/\/api.wordpress.org\/events\/1.0\/","request_args":{"number":5,"ip":"127.0.0.0","locale":"en_US","timezone":"America\/New_York","location":"Portsmouth"},"response_code":200,"response_body":{"location":{"description":"Portsmouth","latitude":"36.8354300","longitude":"-76.2982700","country":"US"},"events":"4 events trimmed."}}
If I search for "Portland, OR", I get this:
[06-Dec-2017 23:01:35 UTC] debug_community_events_response: Valid response received. Details: {"request_url":"https:\/\/api.wordpress.org\/events\/1.0\/","request_args":{"number":5,"ip":"127.0.0.0","locale":"en_US","timezone":"America\/New_York","location":"Portland, OR"},"response_code":200,"response_body":{"location":{"description":"Portland","latitude":"43.6614700","longitude":"-70.2553300","country":"US"},"events":"5 events trimmed."}}
#3
@
7 years ago
- Milestone WordPress.org deleted
- Resolution set to invalid
- Status changed from accepted to closed
Great, thanks for the debugging info. This looks like something we might be able to solve on the API-side, so I created #meta3367.
Searching for "Portsmouth, NH" or "Portsmouth" the widget is showing results near Portsmouth, VA.