• webcart

    (@webcart)


    Hi
    Moved a site to a new server and received a fatal error as follows.
    Deactivating the plugin or uncheck Modify query removed the fatal error.

    Fatal error: Uncaught Error: Call to a member function is_main_query() on null in /--removed--/public_html/wp-includes/query.php:749 Stack trace: #0 /--removed--/public_html/wp-content/plugins/_product-visibility-by-user-role-for-woocommerce/includes/class-alg-wc-pvbur-core.php(101): is_main_query() #1 /--removed--/public_html/wp-includes/class-wp-hook.php(286): Alg_WC_PVBUR_Core->setups_search_cases(true, Object(WP_Query)) #2 /---remived---/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array) #3 /--removed--/public_html/wp-content/plugins/_product-visibility-by-user-role-for-woocommerce/includes/class-alg-wc-pvbur-core.php(234): apply_filters('alg_wc_pvbur_ca...', true, Object(WP_Query)) #4 /--removed--/public_html/wp-includes/class-wp-hook.php(286): Alg_WC_PVBUR_Core->pre_get_posts_hide_invisible_products(Object(WP_Query)) #5 /--removed--/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #6 /--removed--/public_html/wp-includes/plugin.php(515): WP_Hook->do_action(Ar in /--removed--/public_html/wp-includes/query.php on line 749

    Thanks

    • This topic was modified 6 years ago by webcart.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter webcart

    (@webcart)

    By the way, the new server is PHP 7.
    Maybe this is the problem ?
    On the other hand, when I work without the “Modify query” the products are still
    showing on the search results.
    Help will be appreciated…

    I have also seen this error but it happened for me after I installed the Social Warfare plugin.

    Like yourself, if I uncheck the Modify Query option, it works fine. Have had no issues with PHP 7 and it has been running successfully up until then.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fatal error’ is closed to new replies.