Home › Toolset Professional Support › [Closed] Toolset Maps Distance Filter Includes Posts Outside the Radius (Repeating Field)
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 |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Kolkata (GMT+05:30)
This topic contains 13 replies, has 2 voices.
Last updated by Minesh 3 years, 5 months ago.
Assisted by: Minesh.
I am trying to: Use a custom search view to filter posts by distance to a repeatable address field.
I expected to see: Posts in the search results if they have at least one address in the search radius.
Instead, I see: Posts in the search results that have no addresses in the search radius.
Link to a page where the issue can be seen:
Search page: hidden link
Note: To aid troubleshooting, addresses outside the radius are highlighted red in the search results. A post should only be returned if it has at least one bolded address. Typically the script hides addresses & markers outside of the radius. Markers are still hidden on the map. (The script only works with Miles as the unit.)
The issue occurs in searches near certain locations (can't identify a pattern.) These two locations best illustrate the issue:
- Brooklyn, NY: hidden link
- Kansas City, MO: hidden link
Here's a new view using only a distance filter to verify that other filters and/or settings aren't causing the bug (Note that the radius defaults to 5 KM instead of 25 MI): hidden link
Some of the troubleshooting steps I've attempted:
- Switching to the "Twenty Twenty" and "Twenty Twenty One" WP Default Themes
- Disabling all Non-Toolset Plugins
- Removing and reinstalling Toolset plugins
- Recreating the query filter in the existing view
- Creating a new view without a map, other filters, or distance sorting (tried using both the Classic Editor & Block Editor)
- Updating the location field on individual posts that appear incorrectly to trigger geocoding and caching
Hello. Thank you for contacting the Toolset support.
Can you please share admin access details so I can see whats going wrong with your setup.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I've tried to display the distance from the address we input just above the image with every record using the following shortcode:
[toolset-maps-distance-value origin_source='url_param' postmeta='wpcf-address' unit='mi']
=> hidden link
I'm not sure why its displaying the outside radius records as the filter is set to display records within the 25 miles.
So, as I understand, you have two issues:
- posts with outside radius should not be displayed
- posts which have empty address field (where there is no address added should also not be displayed)
Right?
Correct, posts outside the radius aren't being filtered out.
I checked with my test site and I can confirm that the result works as expected.
I mean I checked with the single field not the multiple instance field but as you have added some custom JS to rule out that there is no plugin/theme/custom code conflict.
*** Please make a FULL BACKUP of your database and website.***
Could you please try to resolve your issue by deactivating all third-party plugins as well as with the default theme to check for any possible conflicts with any of the plugins or themes?
- Do you see any different?
The site is running WP's default theme, Twenty Twenty-One and when I deactivate all non-Toolset plugins, the behavior is the same.
I think the issue is with the Toolset Maps cache as the SQL query pulls from "wp_toolset_maps_address_cache.point"
SELECT wp_posts.* FROM wp_posts INNER JOIN wp_postmeta AS tmapsmeta ON ( wp_posts.ID = tmapsmeta.post_id ) INNER JOIN wp_toolset_maps_address_cache ON wp_toolset_maps_address_cache.address_passed = tmapsmeta.meta_value WHERE 1=1 AND wp_posts.post_type = 'counselor' AND ((wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')) AND ST_Distance_Sphere(ST_PointFromText('POINT(-73.944158 40.678178)'), wp_toolset_maps_address_cache.point) < 5000 GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC
The posts are failing to cache the address coordinates properly after they are geocoded.
we will have a new release for Toolset Maps where we are going to offer a new feature (a button) to that will find the missing addresses and add it to "wp_toolset_maps_address_cache" table. It is scheduled to release this week (maybe tomorrow) lets wait for that release and see if that helps you to fix the issue otherwise I will require copy of your site.
Ok, I'll keep an eye out for the update
Just to let you know during QA we found few issues and release is postpone to next week.
I would like to update you we just released new version for almost all Toolset plugins.
We always recommend running your site with the latest stable release plugin version.
*** Please make a FULL BACKUP of your database and website.***
Could you please update ALL Toolset plugins to it's latest officially released version. You can download the latest plugin release from your accounts page:
=> https://toolset.com/account/downloads/
With Maps settings page we added a new button for "Check for missing entries", please check the following screenshot:
- hidden link
I clicked the "Check for missing entries" button and it said "8 missing cache entries found. 8 cache entries processed." Unfortunately, the problem is still occurring.
Can you please share the duplicator copy of your site for the further debugging.
=> https://toolset.com/faq/provide-supporters-copy-site/
I have set the next reply to private which means only you and I have access to it.
Duplicator is incompatible with our hosting provider. Here's a zip file we were able to export: hidden link
I see the file you shared is almost 1.5 GB and its too big. Also, I see that you do not shared the database copy so I will not be able to install anything.
Is it possible for you to send me WP All In one Migration package?
- https://wordpress.org/plugins/all-in-one-wp-migration/
I have set the next reply to private which means only you and I have access to it.
The topic ‘[Closed] Toolset Maps Distance Filter Includes Posts Outside the Radius (Repeating Field)’ is closed to new replies.