When user status is changed from blocked to activate, mail is not sent. However, when status changes from activate to blocked a mail IS sent as expected. Can you please help me debug this?
Please tell me what more information you need me to provide.
I am using Drupal 5.1.
Comments
Comment #1
amitbapat commentedAfter looking through some code here's what I find:
:
switch ($op) {
case 'update':
if (isset($edit['status']) && $edit['status'] != $user->status) {
:
The user_status module assumes that $edit['status'] value will be different from $user->status value IFF the value was changed, but that doesn't seem to be so... I printed the values of $edit and $user in the debug and I find that when the user status changes from active to blocked, $edit['status'] is 0 and $user->status is 1, but when user status changes from blocked to active, both are 1, and that's the reason, no action is taken when user status changes from blocked to active.
Can somebody help me with this?
Comment #2
amitbapat commentedI have found a work around:
It seems that when the status changes from 'Blocked' to 'Active', some other module I have installed, is changing the $account (used as $user) object is changed even before user_status_user gets called. To solve this I had to change the module weight. Here's how I did it:
Detailed help on how to change module weight is available here. http://drupal.org/node/110238
I changed user_status's weight to -1 and now everything works as expected.
I am closing this ticket as I have found my solution. If there are issues with my resolution, please let me know.
Comment #3
j-clark commentedI am having this problem too. I have the "Auto Assign Role Settings" module installed. If amitbapat is correct, then that is probably the cause of my issue. However there is still a bug in that the test the test for change in status is not a sufficient test.
This is a pain in the behind. To get approval working in a sensible manner you have to install the Uer status notification module, which should be part of core functionality. And now it seems we need another flaming module to adjust module weights.
Why didn't I choose alfresco?
Comment #4
j-clark commentedDelete my previous commnet. emails were just slow.