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.

#1 1077838_1_logintoboggan_email_validated.patch435 bytesscor
Members fund testing for the Drupal project. Drupal Association Learn more


scor’s picture

Status: Active » Needs review
435 bytes

hope 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).

hunmonk’s picture

Status: Needs review » Fixed

pity 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.


scor’s picture

yes, this didn't make it to D7, but here is the D8 issue: #999004: user_save() relies on $edit instead of $account.

Status: Fixed » Closed (fixed)

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