In privatemsg's implementation of user hook, there is a rather inane piece of code that works on ops 'insert' and 'update'
It is totally redundant and actually breaks the code when other modules create other categories because when those settings are saved the privatemsg settings get turned to 0.
~line 94
case 'insert':
case 'update':
if (!isset($edit['privatemsg_mailalert'])) {
$edit['privatemsg_mailalert'] = 0;
}
if (!isset($edit['privatemsg_allow'])) {
$edit['privatemsg_allow'] = 0;
}
break;
This entire block of code is totally redundant. Removing it leaves everything functional for me.
The bug:
Running when the hook is called with "update" from another user settings category makes it default to zero, because the checkboxes are not on the category pages and therefore cannot be set. They will fail the isset test and the settings will revert to 0. I imagine this would also break when used with custom profile categories.
Removing this code fixes this problem. There should be no negative side effects but try anyway.
Comments
Comment #1
Ayman commentedI can comfirm the bug, and removing the code seems to fix the problem for me as well.
Comment #2
pegmonkey commented+1.. works for me too..
Comment #3
onionweb commentedthis code should be in "case:register"
it would then set the default email notification to off when new accounts are created.
Having the default notifcation set to on is a sure way to get your site users to tag your site as a spam source.
In fact, I received notice from AOL today that this is happening on a site: users tagging PM notifications as spam because they have forgotten they signed up on the site 6 months ago, or can't figure out how to login and turn off motifications, or just don't have the time to.
Comment #4
mindless commentedI have included this change in 67612.
I also agree with comment #3, so I changed a couple lines so _mailalert defaults to 0 when !isset.
Comment #5
mindless commentedComment #6
(not verified) commented