[Resolved] Distance selection was working, now not working

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.

This thread is resolved. Here is a description of the problem and solution.

Problem:

Toolset Maps 1.8 and 1.8.1 require MySQL 5.7.6 and above to provide distance filtering and sorting capabilities to Views.

Solution:

This is fixed in Toolset Maps plugin version 1.8.2

Relevant Documentation:

This topic contains 11 replies, has 3 voices.

Last updated by DavidW2160 6 days, 3 hours ago.

Assigned support staff: Luo Yang.

Author
Posts
#1282301

I am trying to: Use the Views + Maps distance filter

Link to a page where the issue can be seen:
hidden link
hidden link

I expected to see: the same listing(s) on both pages

Instead, I got: the no-filter page shows the listing(s), the filter page does not. The only difference between the two pages is a distance filter from my address in Cottage Grove, OR 97424, and the listing(s) are also in the same city/zip

This seems to have occurred abruptly with the download of the most recent maps plugin (update) and after conversion of the cache.

The filter set within the view also seems to generate a cached address in San Francisco, no matter what address I tell it in the view distance filter. See uploaded image. This should have been 725 E Whiteaker Ave, Cottage Grove OR 97424

#1282499

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

Thanks for the details, I can see the problem in your website, the distance filter does not work as expected.
I am trying to duplicate the same problem in my localhost, will update here if there is anything found.

#1282595

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

I can get the same result with MariaDB in my locahost, and below error message:

WordPress database error: [FUNCTION wordpress.ST_Distance_Sphere does not exist]

The function ST_Distance_Sphere() was added in MYSQL 5.7.6:
hidden link

but you are using MySQL 5.5.5, so it conducts the problem.

According to our document:
https://toolset.com/toolset-requirements/
The minimal requirement is: MySQL 5.6 and above.

So it should be a bug of Toolset Maps plugin, I have escalated this issue, will update here if there is any news.

#1282763

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Here is the feedback from our developers:
We are working on it. Currently, please try these:
1) Backup your website
2) Downgrade to Maps 1.7.4, no data should be lost and things should continue working as before
You can download it here:
https://toolset.com/download/toolset-maps/#changelog

#1283485

I can't vouch for the accuracy of this post, but there's a potential replacement function for MariaDB users like us:

https://stackoverflow.com/questions/44409012/function-st-distance-sphere-does-not-exist-in-mariadb

CREATE FUNCTION `st_distance_sphere`(`pt1` POINT, `pt2` POINT) RETURNS
decimal(10,2)
BEGIN
return 6371000 * 2 * ASIN(SQRT(
POWER(SIN((ST_Y(pt2) - ST_Y(pt1)) * pi()/180 / 2),
2) + COS(ST_Y(pt1) * pi()/180 ) * COS(ST_Y(pt2) *
pi()/180) * POWER(SIN((ST_X(pt2) - ST_X(pt1)) *
pi()/180 / 2), 2) ));
END

#1283795

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Thanks for the link, I have shared it with our developers.

And we have add a new errata for this issue:
https://toolset.com/errata/maps-1-8-and-1-8-1-require-mysql-5-7-6-or-higher/

#1286501

I can confirm that I'm having this same issue on hidden link

Location filters worked when I initially developed the site, but after updating the Toolset Maps plugin, I found that they no longer function as they once did.

Update: I can also confirm that the previous version of the Toolset Maps plugin allows the distance filter to operate. I just dialed it back now. Will wait for the next release before updating again.

#1287165

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

Here is the feedback from our developers:
This is fixed in Toolset Maps plugin version 1.8.2, it is under QA status, will be released soon.

And According to our document:
https://toolset.com/toolset-requirements/
The minimal requirement is: MySQL 5.6 and above.

So you will need to upgrade the MySQL server to 5.6 or above.

#1287853

I have just confirmed that version update 1.8.2 fixes my problem. Give them my thanks!

#1288333

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Thanks for the confirmation.

#1288829

1.8.2 fixed this issue for me. Thank you!

#1288833

My issue is resolved now. Thank you!