[Resolved] Blank screen + Call to undefined method WP_Tax_Query::get_sql_for_query()

Home Forums Support [Resolved] Blank screen + Call to undefined method WP_Tax_Query::get_sql_for_query()

Home Forums Support Blank screen + Call to undefined method WP_Tax_Query::get_sql_for_query()

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #746576
    Guido

    Resolved:

    Below I mentioned trying to remove custom code from functions.php using the Editor in the Dashboard. This generated the error shown. After loading the Editor again (several times) the custom code seemed to have been removed anyway.

    It wasn’t. After manually removing the custom code from functions.php and reuploading the file using FTP, the site came back to life.

    I was going to switch over to using a Generatepress child theme before going live with the development site. But apparently having custom code where it’s not supposed to be can lead to very wonky things. Lesson learned.

    I’d still be interested if someone can connect the dots. Because even though the issue seems to be resolved, I’m not sure how things went poof.

    Hopefully this can help someone searching for a solution in the future, Generatepress user or otherwise. The fact that the Generatepress Support Forum isn’t closed off to Google is a great asset and selling point for Generatepress for me. Solutions are very easy to find using Google.

    —–

    Question:
    Could you have a look at the error message displayed at the bottom of this post and comment if Generatepress plays a role in the problem I’m experiencing?

    Problem description:
    As far as I’m aware I left the site in question in working order a few days ago. It’s a development site. Today the frontend and dashboard generated a blank screen when trying to reach the site. I followed the general advice regarding the white screen of death.

    Memory limit is set to 256M by my hosting provider. I have 10+ websites with them running similar setups and haven’t experienced this issue until now.

    Disabled all plugins. Dashboard was accessible again. Frontend still blank apart from the site logo for some reason.

    Checked wp-config.php and functions.php for an empty line at the end of the file.

    Activated the 2017 default theme. Loads “ok”, showing large image and site title and tagline, but no content is being displayed. Most of the Dashboard seems accessible, but when I try to load the Posts or Pages overview, the Customizer or the Generatepress Elements overview page I still get a blank screen. When wp debug is set to true, these pages show the error message below instead of a blank screen.

    I had some custom code at the end of the functions.php to change the gravity forms error message (https://docs.gravityforms.com/gform_validation_message/). I tried to remove it and save function.php using the Editor in WordPress and it displayed the error below. The same error is shown on the frontend when wp debug is set to true in wp-config.php.

    I have removed the custom code manually and reuploaded the clean function.php using FTP. So currently there is no custom code in functions.php.

    I’ve uploaded a fresh download of WordPress overwriting the existing core files on FTP. But that didn’t change anything either.

    When I check the database using phpmyadmin the content is still there in the wp_posts table.

    Currently the Generatepress theme is enabled, wp debug is set to true and all plugins including GP Premium are disabled. Enabling GP Premium doesn’t seem to change anything. Neither does disabling the Elements module.

    Thank you in advance for taking a look at this issue. Any advice would be appreciated.

    I’ve googled the error message/similar errors, but didn’t find a solution so far.

    Jouw PHP-wijzigingen zijn teruggedraaid vanwege een fout op regel 277 in het bestand wp-includes/class-wp-tax-query.php. Repareer en probeer opnieuw.
    
    Uncaught Error: Call to undefined method WP_Tax_Query::get_sql_for_query() in wp-includes/class-wp-tax-query.php:277
    Stack trace:
    #0 wp-includes/class-wp-tax-query.php(253): WP_Tax_Query->get_sql_clauses()
    #1 wp-includes/class-wp-query.php(1963): WP_Tax_Query->get_sql('wphdls_posts', 'ID')
    #2 wp-includes/class-wp-query.php(3230): WP_Query->get_posts()
    #3 wp-includes/post.php(1763): WP_Query->query(Array)
    #4 wp-includes/nav-menu.php(660): get_posts(Array)
    #5 wp-includes/nav-menu-template.php(123): wp_get_nav_menu_items(Object(WP_Term), Array)
    #6 wp-content/themes/generatepress/inc/structure/navigation.php(46): wp_nav_menu(Object(stdClass))
    #7 wp-content/themes/generatepress/inc/structure/navigation.php(124): generate_navigation_position()
    #8 wp-includes/class-wp-hook.php(286): generate_add_navigation_float_right('')
    #9 wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('',
    #746894
    Tom
    Lead Developer
    Lead Developer

    Very strange – I can’t think of any reasons for those errors without seeing the custom code etc..

    If the same code worked when uploaded via FTP, it’s possible that things were corrupted when saving directly inside the WP Dashboard.

    Glad it’s all working for you now 🙂

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.