Issue summary (from #11)

The issue seems to be that if you submit a user edit form that is missing the form element for private messages (and your user has the 'allow disabling privatemsg' permission), the module disables private messages for the user. The expected behaviour would be that this should only happen if the form element is present, but the checkbox for 'Enable private messages' is not checked.

Original post:

Hi and thanks for the very useful module,

I have configured the private messages module and everything worked well as I found the configurations quite intuitive. However, at the last moment, I changed the admin username and my problem started! When I go to messages page I get the following message:
"You have disabled Privatemsg and are not allowed to write messages. Go to your Account settings to enable it again." and when I go to Account setting page there is no option for enabling or disabling the private message for admin user as well as other users. I have checked the permissions (and disabled and enabled them again to be sure!) and all authenticated users have "Allow disabling private messages" permission enabled.

I also get the following messages at the bottom of the conversation when I go to old conversations:
"You can not reply to this conversation because all recipients are blocked.

You have disabled private message sending and receiving.
You have disabled private message sending and receiving."

Any help is really appreciated. I have spend few days searching and reconfiguring but couldn't get it to work. Is this a bug or I am missing something?

Thanks,
Amir

Comments

ptmkenny’s picture

Status: Active » Postponed (maintainer needs more info)

I just tried changing the admin username with the 2.x-dev branch (I can't confirm for 1.4 right now) and I did not have this problem.

Have you cleared the cache? If no users are seeing the "Allow disabling of private messages" information, this is probably a permissions problem, which is unlikely to be caused simply by changing a username.

If you are still having this error, on a test site, try upgrading to 2.x-dev and see if you still have the same problem.

AmirKa’s picture

Thanks for the response ptmkenny.

Yes, I have cleared cache many times during testing to make sure nothing cached is causing it. As you mentioned, it should be a permission issue as no one can see the disable/enable setting in account setting.

I will upgrade on a test site to 2.x-dev to see if that changes anything.

I don't think the following is causing the problem; I want to mention it just in case; I changed the admin username from English to something in Arabic.

AmirKa’s picture

I have upgraded to 2.x-dev; however, the problem still persists! I turned off the "Allow disabling of private messages" and enabled it again with no luck. Any suggestion is appreciated.

Thanks

ptmkenny’s picture

What happens if you change the admin name back? Is the admin username account that you changed a generic admin account or the user 1 account?

AmirKa’s picture

ptmkenny,

Thanks for your reply.

Actually, I had tried that as a first possible solution and changed the username back to its original. Regarding the user, yes, it is the user 1.

If I know uninstalling and reinstalling the private message module will resolve this I will do that.

AmirKa’s picture

I disabled and enabled the module and this didn't help. I will uninstall and install private message to see where that goes.

AmirKa’s picture

I uninstalled and reinstalled the module (2.x-dev) on a test site and the problem is gone. I will have to do the same for version 7.x-1.4 to make sure it works as well.

reswild’s picture

I had the same problem: Private messaging got disabled for my admin user (user 1) after I changed my username. In my case, I could see the checkbox for "Enable private messages" on the user edit page, but I would get a 500 error if I tried to turn it back on. (This might be a separate issue: If I allow my users to turn off private messages, they are able to turn it off, but not turn it back on again.)

So what I had to do was change this directly in the pm_setting table in the database:
delete from pm_setting where id = 1 and type='user' and setting = 'disabled';

ptmkenny’s picture

Status: Postponed (maintainer needs more info) » Active
AmirKa’s picture

I am having this problem again!
After reinstalling the module, the admin is able to send and receive messages; however, I created a new admin to send messages to all users and this user gets this message on it's private message page:
"You have disabled Privatemsg and are not allowed to write messages. Go to your Account settings to enable it again."
Similar to before, this user cannot enable private message from Account setting page.

I hope this new detail help resolving this issue.

reswild’s picture

Title: Admin can't send messages after changing admin username » Can't send messages after editing user

I tried to reproduce this, and it only happens when I use a custom form for editing users on my site, and not when I use the standard user edit form.

The issue seems to be that if you submit a user edit form that is missing the form element for private messages (and your user has the 'allow disabling privatemsg' permission), the module disables private messages for the user. The expected behaviour would be that this should only happen if the form element is present, but the checkbox for 'Enable private messages' is not checked.

I'm changing the title for this issue, as the issue doesn't have anything specifically to do with usernames, but is affected by any user edit form submission.

AmirKa’s picture

Great find and many thanks reswild for reporting the cause for the issue. Now pm is working!

AmirKa’s picture

Status: Active » Closed (fixed)
ptmkenny’s picture

Status: Closed (fixed) » Active

I'm not sure why this issue was closed. Although the cause has been identified, I think this point in #11 needs to be addressed:

The expected behaviour would be that this should only happen if the form element is present, but the checkbox for 'Enable private messages' is not checked.

ptmkenny’s picture

Issue summary: View changes

added issue summary

JohnnyW’s picture

I am still getting this error. Has there been a resolution, or suggestions?

oadaeh’s picture

It looks like the logic in privatemsg_user_update() needs some fine-tuning, so that this behavior doesn't happen.
I need to finish a few things I'm currently focused on, and then I need to get the module and my local environment in alignment, and then I can start working on fixing things like this. Hopefully, that won't be much more than a couple of weeks, but it might end up being closer to the end of September.

andersi’s picture

I also seem to be experiencing this particular issue as well. 7.x-1.4

Update: Resolved by uninstalling and reinstalling the module.

ivnish’s picture

Status: Active » Closed (outdated)