Closed (fixed)
Project:
CAS
Version:
7.x-1.x-dev
Component:
CAS
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2012 at 20:00 UTC
Updated:
7 Jun 2014 at 20:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bfroehle commentedThis is not technically safe to call from hook_user_logout(), as it does a drupal_goto() which will prevent later modules' hook_user_logout() from firing. :/
Not really sure if there is a way to get around this limitation.
Comment #2
liam morlandYes, it would have to be called last. If I understand correctly, a module name far down the alphabet would be run later.
Comment #3
bfroehle commentedFrom module_list():
In Drupal 7, we have hook_module_implements_alter() which could be used to move a particular implementation of hook_user_logout to the very end...
Comment #4
liam morlandPerhaps the "This is safe" comment should have a note about that. Or perhaps that comment should be removed, since it is just describing one possible use of the function.
Comment #5
bfroehle commentedIs the issue that we cannot call cas_logout from hook_user_logout because it'd become recursive? If this is the case, I think it'd be cleaner to have
We'd have to choose an appropriate name for $flag, of course.
Comment #6
liam morlandYes, as well, cas_logout() calls watchdog(). If that also went inside the if, that would work. Patch attached.
Comment #7
bfroehle commentedThanks. I've attempted to clean up your patch to avoid extra noise and add some comments.
Out of curiosity, why is the watchdog message problematic?
Comment #8
liam morlandThanks very much. That will do it.
Watchdog would be run twice if it is not inside the if statement.
Comment #9
bfroehle commentedCommitted to 6.x-3.x and 7.x-1.x. Thanks for the original patch!