• Resolved ReactorShop

    (@reactorshop)


    Hi Chouby,

    I downloaded my production server WordPress installation, which it’s still using Polylang 1.1.6, into my testing environment.

    Right after updating it with Polylang 1.2.1, and then trying to navigate to another page inside the WordPress administration side, I get a white page and this server error logged entry:

    PHP Fatal error:  Call to undefined function get_current_screen() in /Library/WebServer/Documents/reactorshop/wp-content/plugins/wp-e-commerce/wpsc-admin/includes/product-functions.php on line 23, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
    PHP Stack trace:, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
    PHP   1. {main}() /Library/WebServer/Documents/reactorshop/wp-admin/network/plugins.php:0, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
    PHP   2. require_once() /Library/WebServer/Documents/reactorshop/wp-admin/network/plugins.php:11, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
    PHP   3. require_once() /Library/WebServer/Documents/reactorshop/wp-admin/network/admin.php:13, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
    PHP   4. require_once() /Library/WebServer/Documents/reactorshop/wp-admin/admin.php:30, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
    PHP   5. require_once() /Library/WebServer/Documents/reactorshop/wp-load.php:29, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
    PHP   6. require_once() /Library/WebServer/Documents/reactorshop/wp-config.php:104, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
    PHP   7. do_action($tag = *uninitialized*, $arg = *uninitialized*) /Library/WebServer/Documents/reactorshop/wp-settings.php:361, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
    PHP   8. call_user_func_array(*uninitialized*, *uninitialized*) /Library/WebServer/Documents/reactorshop/wp-includes/plugin.php:429, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
    PHP   9. PLL_Upgrade->wp_loaded_upgrade_1_2_1(*uninitialized*) /Library/WebServer/Documents/reactorshop/wp-includes/plugin.php:429, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
    PHP  10. PLL_MO->export_to_db($lang = *uninitialized*) /Library/WebServer/Documents/reactorshop/wp-content/plugins/polylang/include/upgrade.php:348, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
    PHP  11. wp_insert_post($postarr = *uninitialized*, $wp_error = *uninitialized*) /Library/WebServer/Documents/reactorshop/wp-content/plugins/polylang/include/mo.php:43, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
    PHP  12. do_action($tag = *uninitialized*, $arg = *uninitialized*, *uninitialized*, *uninitialized*) /Library/WebServer/Documents/reactorshop/wp-includes/post.php:2954, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
    PHP  13. call_user_func_array(*uninitialized*, *uninitialized*) /Library/WebServer/Documents/reactorshop/wp-includes/plugin.php:429, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463
    PHP  14. wpsc_admin_submit_product($post_ID = *uninitialized*, $post = *uninitialized*) /Library/WebServer/Documents/reactorshop/wp-includes/plugin.php:429, referer: https://www.reactorshop.loc/wp-admin/network/update.php?action=update-selected&plugins=polylang%2Fpolylang.php&_wpnonce=a8091df463

    It’s not a show stopper for me, since I’m still using Polylang 1.1.6 at the server, and quickly reverted the upgrade modifications in my development environment, so I can wait.

    Thank you, Chouby!

    https://www.ads-software.com/plugins/polylang/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Chouby

    (@chouby)

    This get_current_screen() function is terrific. Everybody (including me) assumes it is always available… when it is defined quite late. Let’s try to delay the update a bit later (after get_current_screen is defined).

    Could you go in polylang/include/upgrade.php at line 329 and replace

    add_action('wp_loaded', array(&$this, 'wp_loaded_upgrade_1_2_1')); // once wp-rewrite is available
    
    if (did_action('wp_loaded'))
    	$this->wp_loaded_upgrade_1_2_1();

    by

    add_action('admin_init', array(&$this, 'wp_loaded_upgrade_1_2_1')); // once wp-rewrite is available
    
    if (did_action('admin_init'))
    	$this->wp_loaded_upgrade_1_2_1();

    Thread Starter ReactorShop

    (@reactorshop)

    Yep, that solved it!

    Thank you, Chouby!

    Plugin Author Chouby

    (@chouby)

    OK thanks. I’ll include it in the next release.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Call to undefined function get_current_screen()’ is closed to new replies.