Forums › Forums › Search & Filter Pro › Form resets itself to default after submitting
Tagged: default results, reset, same results
- This topic has 8 replies, 2 voices, and was last updated 5 years, 8 months ago by Anonymous.
-
Anonymous(Private) February 12, 2019 at 12:22 am #201922
Hi there,
I am working on an update for a search in a database:
https://www.biodynamicbreath.com/bbtrs-sessions/breathwork-trauma-release-practitioners/And after some changes to the search and clearing the cache, the search does not work anymore.
I have reverted back top the previous version of the search settings (because I cloned the original one to make the changes) but the old search is not working either.Please have a look and let me know what you think how this can possibly resolved.
Thank you!Warm regards,
SebastianTrevor(Private) February 12, 2019 at 12:11 pm #201950I note that you are using WP Engine. Before we dig any further in to any issues raised, the first thing to do, before we try anything else, is to see if your hosting (WP Engine) is the issue (I do not think that it is, but best to make sure).
There is a setting to override a ‘feature’ of WP Engine hosting, that truncates long SQL queries (which ours are). Edit the site wp-config.php file and add this at the top, after line 1 (on a new line 2):
define('WPE_GOVERNOR', false);
PLEASE DO NOT COPY code from the email you receive for this reply, as email systems sometimes alter the quote marks and encode some characters; instead copy it from the actual forum page.
(also see here for another related support note about this – https://support.searchandfilter.com/forums/topic/killed-query-errors-in-log/#post-64826)
Trevor(Private) February 12, 2019 at 12:55 pm #201961The problem is that the governor truncates the sql query sent by wordpress to the database. What we send is a list of Post IDs that are the potential results. As your site grows, and the number potential results grow, the query has a longer list of IDs, and thus is more likely to be truncated. I cannot say if it IS the issue (it often is not), but I need to rule it out. You can edit the wp-config.php file, add in the code. If it makes no difference, take it out again.
Anonymous(Private) February 12, 2019 at 1:09 pm #201970I added it, cleared the cache and tried it in an incognito window, no difference.
What is obvious to me is that the URL is not changing when I submit the search. It stays the same and Ajax is for sure not activated, so the URL should definitely have a parameter.Trevor(Private) February 12, 2019 at 1:20 pm #201978Ah, your last comment gave it to me. Your theme is not loading our JavaScript. It is set to load in the footer, but it is not there. A theme would normally have a number of assets loading in the footer (it is best for SEO scores), but I see none on your site. That suggests that your theme either is not including the wp_footer() just before the body tag closes, or is doing it wrong somehow. This video (about the same issue on another plugin not related to us) is a quick (four minutes) explanation of the issue:
Anonymous(Private) February 12, 2019 at 1:26 pm #201986Haaa … that was it!
I used this code to declutter the site:
// unregister some overload add_action( 'wp_enqueue_scripts', 'wOw_unregister_something' ); function wOw_unregister_something() { // search & filter plugin wp_deregister_script( 'jquery-ui-datepicker' ); wp_deregister_script( 'search-filter-plugin-build' ); wp_deregister_script( 'hoverIntent' ); } // more from search & filter plugin add_action('wp_print_styles', 'remove_sf_styles', 100); function remove_sf_styles(){ wp_dequeue_style( 'search-filter-plugin-styles' ); }
For some reason I thought that the js is in general not needed if Ajax is not activated.
Good to know it always needs to be in there, so what I did not is to comment out this line:
wp_deregister_script( ‘search-filter-plugin-build’ );Now it works again!
Awesome! -
AuthorPosts