WPDiscourse - Logout not working

?request=logout

Results in the following

Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /var/www/vhosts/localhost/html/wp-includes/http.php:251 Stack trace: #0 /var/www/vhosts/localhost/html/wp-content/plugins/wp-discourse/lib/plugin-utilities.php(188): wp_remote_retrieve_response_code() #1 /var/www/vhosts/localhost/html/wp-content/plugins/wp-discourse/lib/sso-client/client.php(477): WPDiscourse\DiscourseBase->validate() #2 /var/www/vhosts/localhost/html/wp-includes/class-wp-hook.php(307): WPDiscourse\SSOClient\Client->logout_from_discourse() #3 /var/www/vhosts/localhost/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters() #4 /var/www/vhosts/localhost/html/wp-includes/plugin.php(476): WP_Hook->do_action() #5 /var/www/vhosts/localhost/html/wp-includes/pluggable.php(1104): do_action() #6 /var/www/vhosts/localhost/html/wp-includes/pluggable.php(660): wp_clear_auth_cookie() #7 /var/www/vhosts/localhost/html/wp-content/plugins/wp-discourse/lib/sso-client/query-redirect.php(68): wp_logout() #8 /var/www/vhosts/localhost/html/wp-includes/class-wp-hook.php(307): WPDiscourse\SSOClient\QueryRedirect->discourse_sso_url_redirect() #9 /var/www/vhosts/localhost/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters() #10 /var/www/vhosts/localhost/html/wp-includes/plugin.php(524): WP_Hook->do_action() #11 /var/www/vhosts/localhost/html/wp-includes/class-wp-query.php(1104): do_action_ref_array() #12 /var/www/vhosts/localhost/html/wp-includes/class-wp-query.php(1792): WP_Query->parse_query() #13 /var/www/vhosts/localhost/html/wp-includes/class-wp-query.php(3586): WP_Query->get_posts() #14 /var/www/vhosts/localhost/html/wp-includes/class-wp-query.php(3718): WP_Query->query() #15 /var/www/vhosts/localhost/html/wp-content/plugins/happyfiles-pro/includes/data.php(197): WP_Query->__construct() #16 /var/www/vhosts/localhost/html/wp-includes/class-wp-hook.php(307): HappyFiles\Data::get_folders() #17 /var/www/vhosts/localhost/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters() #18 /var/www/vhosts/localhost/html/wp-includes/plugin.php(476): WP_Hook->do_action() #19 /var/www/vhosts/localhost/html/wp-settings.php(598): do_action() #20 /var/www/vhosts/localhost/html/wp-config.php(85): require_once('...') #21 /var/www/vhosts/localhost/html/wp-load.php(50): require_once('...') #22 /var/www/vhosts/localhost/html/wp-blog-header.php(13): require_once('...') #23 /var/www/vhosts/localhost/html/index.php(17): require('...') #24 {main} thrown in /var/www/vhosts/localhost/html/wp-includes/http.php on line 251
2 Likes

I’ll take a look at this first thing tomorrow morning CET.

1 Like

No problem thanks, it may be something on my end but would be good to know if you can replicate it or not,

it’s the latest version of Wordpress and Discourse Connect and Discourse.

It’s also PHP 8 (which might be the issue?)

I am using DiscourseConnect as a client not a provider, not sure if that matters?

I will eventually swap it over to Wordpress as the provider but I need to determine the best way to migrate all users :laughing:

2 Likes

This topic was automatically closed after 10 hours. New replies are no longer allowed.

@Fma965 This is a legit bug. It’s been there for almost a year. It occurs when

  • using WP as the DiscourseConnect client;
  • when sync logout is enabled; and
  • (it also depends on your php error handling)

Thanks for reporting it!

Once this is PR is merged and 2.4.5 is released it will be fixed

cc @simon

2 Likes

Thanks @Fma965 and @angus, WP Discourse version 2.4.5 is available in the WordPress repo now.

2 Likes

Thanks Angus, i have already switched the SSO direction around, was simpler than i thought it would be, just imported the users and flagged as being verified already and then get the users to password reset.

Anyway because of this i can’t test it but i’m sure it works as intended thanks for sorting so quickly.

and thanks @simon for releasing it

2 Likes