Support Forums

Support Forums Forums Search & Filter Pro Form resets itself to default after submitting

This topic is: resolved

This topic contains 8 replies, has 2 voices, and was last updated by  Sebastian Schimpf 9 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Sebastian Schimpf
    #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,
    Sebastian

    Sebastian Schimpf
    #201927
    This reply has been marked as private.
    Trevor Moderator
    #201950

    I 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)

    Sebastian Schimpf
    #201957

    Hi Trevor,

    the plugin and search and everything worked for several years,
    Do you think the issue (which is new) is possible still related to WP Engine?
    If yes, I will alter the wp-config,php

    Trevor Moderator
    #201961

    The 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.

    Sebastian Schimpf
    #201970

    I 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.

    Sebastian Schimpf
    #201972

    … when I submit the search!

    Trevor Moderator
    #201978

    Ah, 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:

    https://www.youtube.com/watch?v=h59sy3tUQrc

    Sebastian Schimpf
    #201986

    Haaa … 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!

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Form resets itself to default after submitting’ is closed to new replies.