• This week after we updated Polylang plugin from 3.7.8 to 3.8 our wp-login.php page broke.
    To login and to logout.
    Tried to update to 3.8.1 but the crash continued.

    I had to rollback to 3.7.8 so people could login.

    AI insight:
    The Polylang plugin is attempting to call get_query_var() during initialization (wp_settings.php → hook init), but the global object $wp_query does not yet exist at that point. This is a Polylang compatibility bug—it is executing the “frontend” code (content-based language detection) on the login screen, where the main WordPress query has not yet been initialized.

    [19-Mar-2026 13:24:47 UTC] PHP Fatal error:  Uncaught Error: Call to a member function get() on null in /var/www/htdocs/wp-includes/query.php:29
    Stack trace:
    #0 /var/www/htdocs/wp-content/plugins/polylang/src/frontend/choose-lang-content.php(57): get_query_var()
    #1 /var/www/htdocs/wp-content/plugins/polylang/src/frontend/choose-lang.php(88): PLL_Choose_Lang_Content->get_current_language()
    #2 /var/www/htdocs/wp-content/plugins/polylang/src/frontend/choose-lang-content.php(39): PLL_Choose_Lang->set_language()
    #3 /var/www/htdocs/wp-content/plugins/polylang/src/frontend/choose-lang.php(64): PLL_Choose_Lang_Content->set_language()
    #4 /var/www/htdocs/wp-content/plugins/polylang/src/frontend/choose-lang-content.php(22): PLL_Choose_Lang->init()
    #5 /var/www/htdocs/wp-content/plugins/polylang/src/frontend/frontend.php(134): PLL_Choose_Lang_Content->init()
    #6 /var/www/htdocs/wp-content/plugins/polylang/src/class-polylang.php(280): PLL_Frontend->init()
    #7 /var/www/htdocs/wp-content/plugins/polylang/src/class-polylang.php(224): Polylang->init_context()
    #8 /var/www/htdocs/wp-includes/class-wp-hook.php(341): Polylang->init()
    #9 /var/www/htdocs/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters()
    #10 /var/www/htdocs/wp-includes/plugin.php(522): WP_Hook->do_action()
    #11 /var/www/htdocs/wp-settings.php(593): do_action()
    #12 /var/www/wp-config.php(141): require_once('...')
    #13 /var/www/htdocs/wp-load.php(55): require_once('...')
    #14 /var/www/htdocs/wp-login.php(12): require('...')
    #15 {main}
    thrown in /var/www/htdocs/wp-includes/query.php on line 29
    Stack trace:
    wp-login.php → wp-load.php → wp-config.php → wp-settings.php (hook init)
    → Polylang->init() → PLL_Frontend->init()
    → PLL_Choose_Lang_Content->init() → get_query_var() → FATAL
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ImageChouby

    (@chouby)

    Hello,

    Something’s strange in your install. I have looked at what could happen and it seems that there is no default language. It’s probably not linked to the update but has been revealed by a code change in the new version.

    I could reproduce the error with a browser with no Polylang cookie set and a database that I intentionally corrupted to remove the default language. I could fix it by redefining the default language from the interface.

    In the languages panel one language may appear as default. I suggest that you temporarily define another language as default then redefine the correct language as default. See https://polylang.pro/documentation/support/guides/configure-the-languages/#setting-the-default-language

    Hopefully this will fix your issue.

    On our side, we will try to protect against the fatal error if this case occurs in an install.

    Thread Starter ImageSantiago Sipoli Risden

    (@santiagowd)

    Hi!

    Thanks for your help.

    Acctually i forgot to mention that our install is a multisite WordPress.
    The main site of the network is not in use, but acctually have a language configured.
    One point i just noticed is that this language is the unique to the site, but it’s not setted as default.
    Maybe is related, i dont know.

    Image

    But until this recent update we didn’t have any proplem with this config.

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

You must be logged in to reply to this topic.