Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I believe the following code is wrong:
$edit = array();
$account->logintoboggan_email_validated = TRUE;
user_save($account, $edit);
and $account->logintoboggan_email_validated will not be saved via the call to user_save() (it would have to be in the $edit to have any chance of being persisted). As a result, module such are rules cannot see the logintoboggan_email_validated flag.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1077838_1_logintoboggan_email_validated.patch | 435 bytes | scor |
Comments
Comment #1
scor CreditAttribution: scor commentedhope this patch is self explanatory. the modified $account needs to be passed in to other module via user_module_invoke('update') for it to work (that's how I got LT to integrate with rules, along with #753224-3: port logintoboggan_rules module to 7.x).
Comment #2
hunmonk CreditAttribution: hunmonk commentedpity that user_save() 'refreshes' the $account object just a few lines before it calls the update hook itself -- it'd rather get the more complete treatment of user_save() there -- but, invoking the update hook manually is the same level of functionality that 6.x possessed, so, committed to 7.x-1.x-dev.
thx!
Comment #3
scor CreditAttribution: scor commentedyes, this didn't make it to D7, but here is the D8 issue: #999004: user_save() relies on $edit instead of $account.