Skip Navigation

[Resolved] View not correctly ordering by distance from URL parameter

This support ticket is created 4 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 10 replies, has 3 voices.

Last updated by mikeR-9 4 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#1510451

I am trying to: Ultimately, I'm trying to display the location closest to another location (through a URL parameter). I'm trying to achieve this by returning the first location from a view, ordered by distance from a URL parameter. It is working for some locations, but for others, the ordering is incorrect.

Link to a page where the issue can be seen: I have setup a private page on my server where I'm trying to debug this at [private]

I expected to see: A list of locations with ascending distance values.

Instead, I got: A list of locations with distances out of order.

#1510495

I had to remove my original screenshot and URL -- I didn't realize this thread would be visible to the world. Please email me and I'll respond with sensitive info.

Thanks!

#1511563

Hi, URLs you share in the forum are always obscured from other Users. Only you and the support team here can see them, for privacy. I'll be glad to take a look if you let me know where I can find the View with distance filter.

Have you tried these troubleshooting steps?
- Temporarily deactivate all plugins except Types, Views and Maps, and activate a default theme like Twenty Twenty
- Test again. If you need to place the View on another page for testing, that's fine
- If the problem is solved, reactivate the other plugins and your theme one by one until the problem returns

Let me know what you find out and please share a URL for the test View.

#1513297

I have disabled all plugins except for views, types and maps. I have also switched to twenty twenty.

hidden link

You will see the URL includes a parameter for location. The location is one of the addresses in the list; so you would assume it would be the first location listed. I have included a column which shows the distance from the URL parameter. As you can see, the list is not ordered properly.

#1513321

This environment was setup for you to experiment with. Feel free to log in and make any changes you wish.

#1513461

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Mike,

Christian is currently out today, however he will be back tomorrow to continue working on this issue with you.

Thank you for the continued patience.

#1515295

I've requested permission to access the Duplicator package on Drive. I'd like to do a bit more investigation there because I don't see anything obviously wrong here. Please open up access there so I can take a closer look.

#1516473

I just discovered the map addresses are cached. I blasted every row in wp_toolset_maps_address_cache, then went through each location and re-saved the address info to re-prime the cache, now everything is sorting the way it's supposed to.

#1516475

Okay interesting, I tried clearing cache on a few of the addresses but not all. It didn't seem to make a difference. So if clearing the cache has solved the problem, I think we can consider this one closed. Feel free to resolve here or let me know if the problem resurfaces.

#1518571

Thank you for looking into it with me!

#1518573

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.