• Resolved emilialaunchit

    (@emilialaunchit)


    Hello! Recently we had an extremely outdated version of this plugin on our site, when updating it to this latest version last week – it now produces a critical error when trying to perform a user-switch. Can this be looked into?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    What’s the error?

    Thread Starter emilialaunchit

    (@emilialaunchit)

    hi! The error produces a critical error on the website and the user can’t move forward. Does the link allow you to view it?

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Right but that’s a generic error message, I can’t help without seeing the technical info behind it. Can you take a look in the PHP error log on your site and try to find the corresponding fatal error message?

    Thread Starter emilialaunchit

    (@emilialaunchit)

    Hi John, thanks for getting back to me. I’ve obtained the PHP error log and found this repeated fatal error (site root shortened below):

    PHP Fatal error: Uncaught TypeError:
    user_switching::switch_back_url(): Argument #1 ($user)
    must be of type WP_User, bool given,
    called in wp-content/cache/acorn/framework/views/4518aee64706605bad1ad9628b5f89c369cef95f.php
    on line 29 and defined in
    wp-content/plugins/user-switching/user-switching.php:1029

    The stack trace shows user_switching::switch_back_url(false) and identifies this theme template:

    wp-content/themes/inagrafton/resources/views/sections/header-sms.blade.php

    This happens when I click “Switch To” from the Users screen. We recently migrated the site to WP Engine, and we don’t have access to the original theme developers.

    Does this indicate that the theme’s custom switch-back link needs a check for a valid user before calling switch_back_url()? Any guidance on the correct implementation would be appreciated. Thank you!

    Thread Starter emilialaunchit

    (@emilialaunchit)

    Continued troubleshooting and found code from the prior developer, that didn’t update with the theme’s plugin updates and we discovered the flaw, and were able to fix it. Thank you. Resolved 🙂

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Thanks for letting me know. Glad you got it fixed!

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

You must be logged in to reply to this topic.