Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Using the button to reset filters is malforming the next search query
- This topic has 3 replies, 2 voices, and was last updated 6 years, 2 months ago by
Ernest Marcinko.
-
AuthorPosts
-
March 20, 2020 at 12:24 pm #26324
mp-active01
ParticipantHi,
I have encountered some strange behaviour with the ajax search pro reset button associated with the catergories/taxonomy terms. Currently after using the reset button to reset the state of all filters, the next search will not pull back the correct results.
(1.) First of all performing a search with a filter active and the seach text left blank will return results correctly. The request url will look like this:
https://www.activemw.com/?s=&post_type=projects&asp_active=1&p_asid=1&p_asp_data=1¤t_page_id=75975&woo_currency=GBP&qtranslate_lang=0&filters_changed=0&filters_initial=1&asp_gen%5B%5D=title&asp_gen%5B%5D=content&asp_gen%5B%5D=excerpt&customset%5B%5D=project&termset%5Bproject_category%5D%5B%5D=431(2.) If the reset button is then pressed – clearing the filter options – and a text search is then peformed, it will always bring back no results. The request url will look like this:
https://www.activemw.com/?s=paul&post_type=projects&asp_active=1&p_asid=1&p_asp_data=1¤t_page_id=77084&woo_currency=GBP&qtranslate_lang=0&filters_changed=0&filters_initial=1&customset%5B%5D=project(3.) Performing the same text search as showed in (2.) from a fresh page load rather than first having cleared all filters with the reset button will create a request url like below. This search query is always successful and pulls back the correct results.
https://www.activemw.com/?s=paul&post_type=projects&asp_active=1&p_asid=1&p_asp_data=1¤t_page_id=-1&woo_currency=GBP&qtranslate_lang=0&filters_changed=0&filters_initial=1&asp_gen%5B%5D=title&asp_gen%5B%5D=content&asp_gen%5B%5D=excerpt&customset%5B%5D=projectThe only difference I can see between request (2.) and (3.) is the exclusion of the parameters
asp_gen%5B%5D=title&asp_gen%5B%5D=content&asp_gen%5B%5D=excerpt. If you could clarify why using my reset button is malforming the next search request that would be extremely helpful.Many thanks,
Michael Priest
March 20, 2020 at 2:48 pm #26325Ernest Marcinko
KeymasterHi Michael,
Thank you for the details, I was able to replicate this issue on our local test servers, so this is a yet unknown bug. Luckily it is only a minor error, so it can be fixed via a simple file edit.
If you want, I can do that for you via FTP, or your can do it as well, just follow these steps:1. Make sure to have a full site back-up just in case.
2. Open up the wp-content/plugins/ajax-search-pro/includes/views/asp.shortcode.general.php file via FTP file editor on your server
3. Change it’s contents to this
4. Save the fileThe issue should be gone.
March 20, 2020 at 5:15 pm #26330mp-active01
ParticipantHi Ernest,
Thank you for your speedy response.
I have followed your steps and updated our files with your suggested solution. I can confirm the search does appear to be behaving as expected now.
Thanks again,
Michael
March 21, 2020 at 10:38 am #26335Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- You must be logged in to reply to this topic.