Skip Navigation

[Resuelto] Latest maps update broke distance search

This support ticket is created hace 5 años, 4 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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)

Este tema contiene 15 respuestas, tiene 2 mensajes.

Última actualización por scottL-3 hace 5 años, 3 meses.

Asistido por: Christian Cox.

Autor
Mensajes
#1282179

I am trying to: search by distance

Link to a page where the issue can be seen: enlace oculto

I expected to see: Put in a zip code and select the location, hit the search button, see results. 01460, for example, should show several results. This worked until the Maps update. Now it says no results for all zip codes I've tried.

Instead, I got:
No results.

#1282215

Hi, can you take some screenshots in wp-admin so I can see how this View is set up? Please be sure to open the Query Filter panel options so I can see the settings there for your distance filter. Please also copy all the code in the Search and Pagination panel and paste it here in your next reply. I'll review everything and give you some additional feedback.

#1282223
Screen Shot 2019-07-02 at 4.54.35 PM.png
Screen Shot 2019-07-02 at 4.54.27 PM.png
Screen Shot 2019-07-02 at 4.54.06 PM.png
Screen Shot 2019-07-02 at 4.53.46 PM.png
Screen Shot 2019-07-02 at 4.53.33 PM.png
Screen Shot 2019-07-02 at 4.53.23 PM.png
Screen Shot 2019-07-02 at 4.53.03 PM.png
Screen Shot 2019-07-02 at 4.53.11 PM.png

Hi Christian, attached are the screenshots.

The partner CPT is a Toolset CPT with an address field, a checkbox field that excludes some partners from the search and a custom taxonomy from which only certain partner categories are included in the search. If the View is re-created with only the distance search, nothing changes so the other filters are not relevant to the problem as far as I can tell.

Here are some of the sections as text to make it easier if you want to copy and paste into a test site:

Search & Pagination
=================
[wpv-filter-start hide="false"]
[wpv-filter-controls]
<div class="row full-width-banner" style="background-color:#54595f;">
<div class="search-box">
<div class="row search-row">
<div class="col-sm-12">
<h1 style="color:white;">FIND AN INSTALLER FOR YOUR STONE PROJECT</h1>
<p>Find installers that have experience working on stone projects like yours. Enter the zip code of your project to find a choice of installers.</p>
<p>Call us directly for recommendations at 978-742-9800. We’ll match you and your project with the appropriate installers in your area.</p>
<br>
<label>Project Location</label> (City, State OR Zip code)
[wpv-control-distance default_distance="30" default_unit="mi" compare_field="partner-location-address" distance_center_url_param="toolset_maps_distance_center" distance_radius_url_param="toolset_maps_distance_radius" distance_unit_url_param="toolset_maps_distance_unit" inputs_placeholder="%%CENTER%%" visitor_location_button_text="Get my GPS location"]
[wpv-filter-submit output="bootstrap" class="btn search-btn"]
</div>
</div>
</div>
</div>

[/wpv-filter-controls]
[wpv-filter-end]

Loop
====
[wpv-layout-start]
[wpv-items-found]
<div class="row">
<div class="col-sm-12" style="text-align:right;padding-top:25px;padding-bottom:5px;">

</div>
</div>
<!-- wpv-loop-start -->
<wpv-loop wrap="2" pad="true">
[wpv-item index=1]
<div class="row">
<div class="col-sm-6 blog-row">[wpv-post-body view_template="loop-item-in-copy-of-installer-finder-view-as-backup"]</div>
[wpv-item index=other]
<div class="col-sm-6 blog-row">[wpv-post-body view_template="loop-item-in-copy-of-installer-finder-view-as-backup"]</div>
[wpv-item index=2]
<div class="col-sm-6 blog-row">[wpv-post-body view_template="loop-item-in-copy-of-installer-finder-view-as-backup"]</div>
</div>
[wpv-item index=pad]
<div class="col-sm-6 blog-row"></div>
[wpv-item index=pad-last]
<div class="col-sm-6 blog-row"></div>
</div>
</wpv-loop>
<!-- wpv-loop-end -->
<div class="row"><div class="col-sm-12">
[wpv-pager-nav-links output="bootstrap" previous_next_links="true"]
</div></div>
[/wpv-items-found]
[wpv-no-items-found]
<div class="row"><div class="col-sm-12"><h3>No installers found, try a different search or contact Stoneyard:</h3></div></div>
[/wpv-no-items-found]
<div class="row"><div class="col-sm-12">
<p>If no partners were found near your desired location please contact Stoneyard® directly:</p>
<h3 style="margin-bottom:0px;">enlace oculto">Stoneyard.com</h3>
265 Foster Street, Littleton, MA 01460<br>
Contact: National Sales  978-742-9800<br>
Stoneyard Dealer<br><br>
</div>
</div>
<div class="row pad-top blog-row">
<div class="col-sm-12">
<h2>Add Your Company to Our enlace oculto">Search App</h2>
If you would like to be listed as a:

  • Stone Installer
  • General Contractor
  • Tile Flooring Installer

Please click below:<br>
enlace oculto"><button>How to become a Stoneyard Partner</button>
</div>
</div>
[wpv-layout-end]

Content Template
================
<h3 style="margin-bottom:0px;">[wpv-post-link][wpv-conditional if="( $(wpcf-featured-partner) eq '1' )"] <span class="badge">Featured</span>[/wpv-conditional]</h3>
[types field='partner-location-address'][/types]<br>
[wpv-conditional if = "('[toolset-maps-distance-value origin_source='url_param' postmeta='wpcf-partner-location-address' unit='mi']' ne '')"]
<small>About [toolset-maps-distance-value origin_source='url_param' postmeta='wpcf-partner-location-address' unit='mi'] miles</small><br>
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-partner-business-phone) ne '' )"][types field='partner-business-phone'][/types]<br>[/wpv-conditional]
[wpv-conditional if="( $(wpcf-partner-contact-name) ne '' )"]Contact: [types field='partner-contact-name' output='raw'][/types][/wpv-conditional][wpv-conditional if="( $(wpcf-partner-contact-email-address) ne '' )"]  [/wpv-conditional][wpv-conditional if="( $(wpcf-partner-contact-phone) ne '' )"] [types field='partner-contact-phone' output='raw'][/types]<br>[/wpv-conditional]
[wpv-post-taxonomy type="partner-category" format="name"]<br>
enlace oculto;">Request Quote

#1282291

Also, I tested on a staging copy of the site that is still on Maps 1.7.4 and everything still works there.

You can view it at enlace oculto if you want to compare results, inspect output, check js console (no errors there), etc. but I think the issue is a backend issue not a frontend issue.

If I turn on wp_debug I do not see any errors related to anything Toolset. There is just one error related to Events Manager that has been happening for a long time and preceded the distance search issue.

#1282299

Okay thanks.
- Did any error messages appear when you ran the data migration process after updating to 1.8 or 1.8.1?
- Go to Toolset > Settings > Maps and click "Check API". Let me know the response.
- In the same settings page, scroll down to Cached Data and delete at least one address that should appear in the 01460 zip code.
- Test the map again and let me know if that result begins to appear. If not, I'll need to log in and take a closer look. Please provide login credentials in the private reply fields here.

#1282321

Okay thanks, I'm working in staging now for a bit. Do I have permission to make a clone of the site if necessary so I can run local tests? This will allow me to watch code execution and inspect the database. I will install the Duplicator Pro plugin to create that clone.

#1282323

Yes, you can clone the site if needed. Just please delete your copy when you are done.

#1282333

Okay thanks, I wasn't able to get this working with Maps 1.8.1 in staging so I did end up creating a clone. I'll continue testing and give you an update first thing tomorrow. Until then, I have rolled back to maps 1.7.4 in staging so you can test before rolling back in production, if you want.

#1282335

Thanks Christian. Do I need to do anything in the database to rollback or just replace the plugin files?

#1282337

Disregard last question. I rolled back the live site successfully.

#1283185

Okay I was unable to replicate the problem on my local environment yesterday using the site clone, curiously. The distance-based searches work as expected. That indicated some difference in our server environments, but I didn't have time to do a full analysis. Then overnight some other tickets arose and the team discovered that there is a problem with Maps distance searches in MySQL versions lower than 5.7.6. I'm fairly confident this is the case for your site (using MySQL 5.5.5), but I will continue testing to be sure. An erratum has been posted here: https://toolset.com/errata/maps-1-8-and-1-8-1-require-mysql-5-7-6-or-higher/
I wanted to give you all the information I have this morning, and I will continue to update you here as investigation proceeds. Your rollback to Maps 1.7.4 is still my best advice for now.

#1283193

Thanks for the update. In case it is relevant, the database it actually MariaDB 10.1.38. The database client on the web server is MySQL-dev 5.0.12. I'm going to check with Kinsta to see if they can update the MYSQL client and / or MariaDB on staging so I can do some testing there and if that goes well I'll have them update production.

If the team figures out what is going wrong and can fix on the older MySQL versions please let me know.

#1283207

Did a little digging and it seems MariaDB does not support ST_Distance_Sphere in any version. Is that the function that Toolset is using for the new, improved Distance searching in Maps 1.8.x? If so, it isn't going to work on any hosting that uses MariaDB such as Kinsta, A2, DigitalOcean, Amazon RDS, Google Cloud and anything based on Google Cloud and more.

#1283223

Okay thanks. Yes, ST_Distance_Sphere is at least part of the issue here. I'll pass your information along to my 2nd tier team.

#1316643

Hi, wanted to see if this issue resolved in the latest Maps release, or are you still experiencing problems after updating?