In the _logintoboggan_process_validation() function, it calls user_module_invoke('update', ...) so that other modules can react to the user having been validated. I've got a custom module, that controls a users registration to a mailing list. I've got a hook_user that checks for 'after_update' because it needs to also catch changes to $account->language. Users should only be on the mailing list if they are validated.

Anyway, to make a long story short, logintoboggan only fires 'update' and not 'after_update' so my code doesn't happen. Of course, I can put in a bunch of hacks (like $account->language = $edit['language']) so that I can do my mailing list updates in 'update', but I really think that logintoboggan should call 'after_update' as well as 'update'. Other modules which depend on 'after_update' to react to user changes will also be broken.

Here is a very small patch that makes this change.


logintoboggan-after_update.patch457 bytesdsnopek


hunmonk’s picture

Status:Needs review» Postponed (maintainer needs more info)

before i commit this, i'd like to get clear on how this will impact the 7.x branch.

looking at, i don't see any hook_user_after_update() for 7.x, only hook_user_update(). does the 7.x update hook now happen at the same time as the 6.x after_update hook?

if so it would appear no change is needed for 7.x. if not, then that seems like a regression in core functionality...

dsnopek’s picture

I don't know Drupal 7 (yet!), but its possible that hook_user_presave() is the equivalent there? The idea is a hook that runs after all the 'update' / 'insert's have run. This is just my impression looking over the documentation for about 1 minute. We'll need the opinion of someone who actually knows Drupal 7.

hunmonk’s picture

Status:Postponed (maintainer needs more info)» Needs work

so, given that documentation, we also need a patch for 7.x, then i can move forward to commit all necessary changes.

YK85’s picture


hunmonk’s picture

Title:_logintoboggan_process_validation() should also user_module_invole('after_update', ...)» _logintoboggan_process_validation should also invoke after_update hook
Status:Needs work» Fixed

turns out 7.x doesn't need any change. committed to 6.x-1.x-dev, thanks!

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.