On a drupal 4.7 RC1 with CVS module: I receive an email when I make a change to user profile (created before module installed). I'll try to look more into it I'm surprised of such a bug because if it was happening to everybody there would be an issue about it here for sure and this bug would be corrected.
Note i received the email account blocked but the account is not blocked (thankfully)
I'm using module version 1.4 from 20 march
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | only_if_status_changes.patch.1 | 982 bytes | dww |
| #6 | only_if_status_changes.patch | 895 bytes | dww |
Comments
Comment #1
alliax commentedI looked in the module code and in my opinion the bug can happen only in this part of the code :
So do you have any idea why it behaves like that on my website ?
Comment #2
alliax commentedin fact to be more precise, I think the problem is on this line :
since it is because the module thinks that I've updated the status (when I just make profile changes) and that the status is now UNACTIVE that it triggers an email for account blocked!
So is $edit['status'] really a good variable ?
Comment #3
gte451f commentedI can confirm on RC2, when I change a user profile I get an email saying that there have been account changes but the body says....
Hello user,
Your account on GameTrust has been blocked.
Comment #4
LuckyOne commentedMaybe it would help if rewritten as follows:
if ($edit['status'] != $user->status) {
should become
if (isset($user->status) && isset($edit['status']) && $edit['status'] != $user->status) {
Could somebody try that because I just cannot reproduce this bug...
Comment #5
alliax commentedStill on RC1, I tried your change and it works as it should, thank you!
Comment #6
dwwsorry y'all, i've been on vacation in brazil for 2 weeks, and totally out of touch with drupal. just got back today. i don't have time right now to fully test/review this bug. is this the patch y'all are proposing should go in? i'll take a closer look tomorrow (and probably commit it) but i just wanted to be sure we're all talking about the same change. ;)
thanks,
-derek
Comment #7
dwwthe check for
isset($user->status)is unnecessary, since the user object will *always* have a status (or things are really busted). ;) i committed the attached simplified version of this patch to 4.6, 4.7 and CVS head. thanks to everyone for the report and the suggested fix.-derek
Comment #8
dwwwhoops, forgot to attach the patch (for the interested reader)
Comment #9
(not verified) commented