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.
Users who have their 'Personal contact form' un-checked still display a 'contact' tab when viewing their profile which serves no purpose.
An admin should be able to disable users even seeing this option in their user profile to begin with.
Patch adds a permission for admin to control what user roles get the change to use the personal contact form now.
Comment | File | Size | Author |
---|---|---|---|
#12 | contact_form_hide.patch | 2.28 KB | webchick |
#11 | contact.module_23.patch | 1.67 KB | webchick |
#4 | _60483_comment_tab_2.patch | 1.64 KB | Morbus Iff |
#3 | _60483_comment_tab_1.patch | 1.68 KB | Morbus Iff |
#2 | _60483_comment_tab_0.patch | 1.39 KB | Morbus Iff |
Comments
Comment #1
Morbus IffYou're talking about two different things.
* BUG: The tab shows up regardless of whether the user has asked to be contacted.
* SOLUTION: Stop the tab from showing up when the user has asked to not be contacted.
Your solution is a feature request, and doesn't actually solve the bug at all - it just pushes the responsibility onto the admin: "if you don't want the tab to show up, remove the ability for ANY user to be contacted". That's just wrong. Attached is a patch that actually solves the bug, without adding new features.
Comment #2
Morbus IffSame patch, just twiddled the location of the access check.
Comment #3
Morbus IffHrm, we shouldn't even build the menu item. This requires an if not an access check.
Comment #4
Morbus IffGrr.
Comment #5
buddaThe contact tab has gone.
+1
Comment #6
Morbus IffComment #7
Dries CreditAttribution: Dries commentedI like the current behavior better:
Comment #8
Morbus IffI'll agree #2 needs to be fixed. I disagree on #1. That's like saying "Let's show every user every administer link, to let them know that the functionality exists, but we'll just show them an error message when they try to access it" - it's the proverbial "shatter the hopes and dreams" problem - give the user the appearance that they have that option, and then shatter it by saying "just kidding".
Comment #9
Zen CreditAttribution: Zen commentedhttp://drupal.org/node/41352 might make #1 in Dries' last post (partially) moot. I'll reroll that patch shortly.
-K
Comment #10
webchickyeah, this is bugging me. leaving my mark so I can roll a patch later. ;)
Comment #11
webchickThis patch is essentially the same as Morbus's, except that it does not hide the contact form for people with "administer users" privileges.
I also disagree with leaving the tab there when it does nothing. We don't show "edit" tabs on every node, only those the user has edit permissions on. This is the same thing, imo. And now that the patch got in to make contact forms enabled by default, it should hopefully be fairly obvious that if a contact form is disabled it means the user doesn't want to be bothered by people.
Comment #12
webchickActually... looks like we can remove some of this access check stuff from contact_mail_user as well, now that this is handled @ hook_menu.
Comment #13
webchickComment #14
webchickComment #15
Dries CreditAttribution: Dries commentedOK, I agree. Code looks cleaner too! Committed to CVS HEAD. Thanks.
Comment #16
Dries CreditAttribution: Dries commentedComment #17
(not verified) CreditAttribution: commented