Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 512573

Plugin Changes Broke Search where values contain slash /

$
0
0

Replies: 0

Hello,

It took me a little bit to track this down but here’s the story;
We have a search set-up here – http://duttons.com/rentals/listings/
The first field Building Type (building_type) has two possible values;
Condo/Apartment
House/Duplex/Townhouse

Searching with this was working originally. We just noticed it stopped working so I did a test with a value of ‘Test’ for building_type which was searchable. Switching that to ‘Test/Value’ made it so that it was no longer searchable.
This confirmed my suspicion that slash (/) within search values wasn’t functional.

So diving into the code I found within wp-property/lib/class_functions.php and it’s get_properties function this if conditional that checks for values containing slash;
if( !in_array( $meta_key, (array) $commas_ignore ) && substr_count( $criteria, ',' ) || ( substr_count( $criteria, '-' ) && $numeric ) || substr_count( $criteria, '--' ) || substr_count( $criteria, '/' ) ) {
*The check for slash || substr_count( $criteria, '/' ) looks to be added in this commit (line 2968);
https://github.com/wp-property/wp-property/commit/9fcf8debde3a95def2a80623a159ba05cef15d5c#diff-13d43b4b5ea854e4c6685f0a53ddd50f

This change has broken the search when values contain slash and isn’t providing any benefit for the rangefields. Please remove the slash check as it’s not necessary. Without it the search criteria is saved in the $specific variable as required for the search to work.

Please remove that specific check or roll back to fix the plugin search functionality please.

Thank you


Viewing all articles
Browse latest Browse all 512573

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>