• Resolved mikacns

    (@mikacns)


    Hey,

    I am getting the following error in server logs which causes posts/pages to go blank and display error 500 on the backend.

    PHP Fatal error: Uncaught Error: Call to undefined function get_current_screen() in /home/site3437823/public_html/wp-content/plugins/siteorigin-panels/inc/admin.php:1190

    Is there anything I can do to fix it?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor alexgso

    (@alexgso)

    Hi mikacns,

    Really sorry about this issue!
    Can you please clarify what version of WordPress you’re using? I ask as I’ve checked the identified line and this issue should only really occur if you’re using a really old version of WordPress.

    If you aren’t using an older version of WordPress, can you please clarify when and where this issue occurs? Does it happen when you try and edit posts? Does it happen when you try and adjust your portfolio settings?

    Thread Starter mikacns

    (@mikacns)

    We’re using the latest version of WordPress. The issue only occurs when I update another plugin (WPSSO Core Pro), but their support is adamant that it’s actually Site Origin that’s causing the issue per following server log:

    2018/09/17 09:54:36 [error] 26402#26402: *17754 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function get_current_screen() in /home/site3437823/public_html/wp-content/plugins/siteorigin-panels/inc/admin.php:1190
    Stack trace:
    #0 /home/site3437823/public_html/wp-includes/class-wp-hook.php(286): SiteOrigin_Panels_Admin->disable_gutenberg_for_panels_posts(true, 'post')
    #1 /home/site3437823/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #2 /home/site3437823/public_html/wp-content/plugins/gutenberg/lib/register.php(332): apply_filters('gutenberg_can_e...', true, 'post')
    #3 /home/site3437823/public_html/wp-content/plugins/wpsso/lib/com/util.php(1150): gutenberg_can_edit_post_type('post')
    #4 /home/site3437823/public_html/wp-content/plugins/wpsso/lib/admin.php(91): SucomUtil::is_doing_block_editor()
    #5 /home/site3437823/public_html/wp-content/plugins/wpsso/wpsso.php(365): WpssoAdmin->__construct(Object(Wpsso))
    #6 /home/site3437823/public_html/wp-includes/class-wp-hook.php(286): Wpsso->set_objects('')

    I am wondering if there is a conflict between the two plugins.

    It happens when their plugin is updated and I try to access/edit any post/page or even Woocommerce order (custom post type). Everything on the front end works fine.

    They suggested you check the DOING_CRON and DOING_AJAX constants – as the function you are calling is not always loaded by WordPress.

    Plugin Contributor alexgso

    (@alexgso)

    Hi Mikacns,

    Thank you for clarifying.
    Okay so based on what you outlined, it sounds like this error isn’t directly visible on frontend and occurs as a result of some Ajax WPSSO Core Pro uses. Is that correct?

    I’ve forwarded your post to the development team.

    Thread Starter mikacns

    (@mikacns)

    Yes, that is correct. Much appreciated.

    FYI – The following should give you all the information you need:

    
    2018/09/17 09:54:36 [error] 26402#26402: *17754 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function get_current_screen() in /home/site3437823/public_html/wp-content/plugins/siteorigin-panels/inc/admin.php:1190
    Stack trace:
    #0 /home/site3437823/public_html/wp-includes/class-wp-hook.php(286): SiteOrigin_Panels_Admin->disable_gutenberg_for_panels_posts(true, 'post')
    #1 /home/site3437823/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(true, Array)
    #2 /home/site3437823/public_html/wp-content/plugins/gutenberg/lib/register.php(332): apply_filters('gutenberg_can_e...', true, 'post')
    

    You’ve hooked the gutenberg_can_edit_post_type filter and called a WordPress function that does not exist.

    js.

    FYI #2 – Just because is_admin() is true, does not mean ALL admin related functions (like get_current_screen) are available – is_admin() is also true for Ajax and cron jobs – where there is no browser involved – and of course, Gutenberg does a lot of Ajax calls. 😉

    js.

    Plugin Support Andrew Misplon

    (@misplon)

    Thanks for the feedback. A fix will be included in the next Page Builder update:
    https://github.com/siteorigin/siteorigin-panels/commit/4e320a77f7a84f9c479fbb081dadb436cfac06ee

    All the best.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘PHP Fatal error’ is closed to new replies.