Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am unable to access messages/new with admin (uid 1). I'm testing with garland theme.
Has there been any recent changes to 6.x-2.x-dev that may have caused this?
Comment | File | Size | Author |
---|---|---|---|
#9 | privatemsg_allow_disabling_setting2.patch | 5.45 KB | Berdir |
#5 | privatemsg_allow_disabling_setting.patch | 3.9 KB | Berdir |
Comments
Comment #1
BerdirHave you disabled private messages in your profile for uid 1?
Comment #2
robby.smith CreditAttribution: robby.smith commentedwow, I didn't even know such an option existed.
Is there any way of preventing uid 1 and all users from turning this option off?
Thanks!
Privatemsg settings
[ ]Enable Private Messaging
Comment #3
BerdirSee title, I think we can and should two things to improve UX and DX (fancy words):
- Add a permission which allows users to control this setting
- Display a notice on all /messages pages informing the user that he has disabled privatemsg and is not allowed to create messagings, including a link to his profile where he can enable it again.
Comment #4
robby.smith CreditAttribution: robby.smith commentedI believe the above two would be a great check to have!
"Display a notice on all /messages pages informing the user that he has disabled privatemsg and is not allowed to create messagings, including a link to his profile where he can enable it again."
Can the above be an option that the admin can choose in the settings? Also, for the benefit of themers it would be nice to allow checking for this variable in a template file and if/if not existing to do as they please (for example show specific text or an image etc)?
Thanks!
Comment #5
BerdirTry the patch. Adds a permission and displays a warning message. The warning message can be disabled.
Uhm. You could simply call privatemsg_is_disabled($account) for that, is it really necessary to have a variable?
Comment #7
robby.smith CreditAttribution: robby.smith commented"Adds a permission and displays a warning message. The warning message can be disabled."
This sounds great!
If it is possible to do it without a variable then I agree it isn't necessary. Could you please share how to "call privatemsg_is_disabled($account)" can be used in a template file (ie node.tpl.php or a view template file). Would it just be like (would this call be available in any template file):
Also, it looks like the patch failed testing above. Should I still try applying myself?
Thanks!!
Comment #8
YK85 CreditAttribution: YK85 commentedsubscribing
Comment #9
BerdirFixed the tests...
Yes, you can use it like that in every template (the () are missing from your if, though...)
Comment #10
BerdirCommited to 6.x-2.x-dev and 7.x-1.x-dev. We need to clean up the admin settings UI a bit, opening a new issue for that.