Skip Navigation

[Resolved] custom search stopped working after WordPress update

This support ticket is created 5 years, 5 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 6 replies, has 2 voices.

Last updated by ericW-8 5 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#1273687

I am trying to: use my custom search (View=Custom Grid)

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

I expected to see:
Search that could be used by any parameter (as pre-WP update].
(NOTE: Pre GeneratePress and WordPress updates on Tuesday, June 18 everything worked beautifully. The GeneratePress update broke my Display Currency Script. I repaired that in the theme's functions php. Today, I realized my search was not working either.)

Instead, I got: "No Results Found" and hiding my Extended Amenities Search function when I choose either the Acreage or Sales Price options.

ONLY the County Search is working correctly.

In Toolset Settings, custom code for search_acreage_range was added by one of your techs. It shows to be DEACTIVATED. I Activated it but it didn't change anything that I could tell, so I've deactivated it again.

*****
Through the help of the Toolset Support Team, the search was working beautifully. I could search by any or all parameters.

Now, the entire form is a mess.

It will search by County and return appropriate fields, but to try and search by price range and/or acreage returns no results.

Also, my property amenities search is not working properly either. When I try to search by Acreage or Sales Price it hides all options.

I'm fairly sure I had the search set to search by OR rather than AND, but the view shows an AND argument. I tried resetting it, but again, no difference.

HELP! I'm literally hours from taking this site live.

#1273707

Shane
Supporter

Languages: English (English )

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

Hi Eric,

The custom code that controls this have been missing.

Could you let me know the code that was written for this range item ?

Thanks,
Shane

#1273721

Hi Shane,
I'm not sure which custom code you mean.

#1273725

I think I may have found it.

Is this what you mean? I found it in my original request.

add_filter('wpv_filter_query', 'search_between_acreage_func', 90, 3);
function search_between_acreage_func($query, $setting, $view_id) {
if($view_id == 1897){ // specific Views ID
foreach((array)$query['meta_query'] as $k=>$v){
if(isset($v['key']) && $v['key']=='wpcf-total-acreage'){ // custom field total-acreage
if( isset($_GET['wpv-wpcf-total-acreage']) && !empty($_GET['wpv-wpcf-total-acreage'])){ // with URL parameter wpv-wpcf-total-acreage
$query['meta_query'][$k]['value'] = str_replace("-",",",$_GET['wpv-wpcf-total-acreage']); // apply the range filter
}else{ // without URL parameter wpv-wpcf-total-acreage
unset($query['meta_query'][$k]); // remove the range filter
}
break;
}
}
}
return $query;
}

#1273727

Shane
Supporter

Languages: English (English )

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

Hi Eric,

Yes that is correct, this needs to be added back to the custom code snippets and re-activated.

Thanks,
Shane

#1273731

It appears to be the same issue I had with the GeneratePress update and my currency code.
When I replaced it, the code worked again.

#1273745

Shane helped point me in the right direction. I fixed the problem on my own, but he is the one who brought the probable issue to my attention.