The logout functionality stops working after using services along with bakery module (http://drupal.org/project/bakery) and applying this patch (http://drupal.org/node/1369660#comment-5360870). In my opinion this actually is the way its supposed to work, calling the user_module_invoke('logout') hook before destroying the session, like core does -> http://drupalcode.org/project/drupal.git/blob/7c4e429b7fa771676a18321aac...
@@ -401,10 +401,10 @@ function _user_resource_logout() {
watchdog('user', 'Session closed for %name.', array('%name' => theme('placeholder', $user->name)));
- // Destroy the current session:
- session_destroy();
$null = NULL; // Only variables can be passed by reference workaround
user_module_invoke('logout', $null, $user );
+ // Destroy the current session:
+ session_destroy();
// Load the anonymous user
$user = drupal_anonymous_user();
Comments
Comment #1
artkon commentedComment #2
cotto commentedAfter looking into this a bit, I agree with the #1 patch. Core Drupal 6.22 from d.o does not do what you said, but Pressflow does and the Pressflow approach makes sense to me after a bit of digging. Without the patch, it isn't possible for a hook_user logout implementation to mess with $SESSION data, which it should be able to do. It's not entirely surprising that this issue wouldn't be common since most modules don't care about implementing
hook_user('logout', ...).The patch makes sense and doesn't cause any new failures, so moving this to rtbc. Thanks for reporting!
Comment #4
marcingy commentedThe issue still exists in 7.x so we need to fix it there first - the logic makes sense though for doing this change and this patch looks good for 6.x
Comment #5
cotto commentedHere's a 7.x-3.x version.
edit: ignore this patch. A more correct one is in the next comment.
Comment #6
cotto commentedprevious patch was wacky. Here's a better one.
Comment #7
kylebrowning commentedlooks commit, go ahead and commit both!
Comment #8
cotto commentedfixes for 6.x-3.x and 7.x-3.x committed in 6d1d558 and d2750e6, respectively. Thanks for reporting!
Comment #11
marcingy commentedPlease do not randomly requeue patches that were merged a long time ago