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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Morbus Iff’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1.39 KB

You'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.

Morbus Iff’s picture

FileSize
1.39 KB

Same patch, just twiddled the location of the access check.

Morbus Iff’s picture

FileSize
1.68 KB

Hrm, we shouldn't even build the menu item. This requires an if not an access check.

Morbus Iff’s picture

FileSize
1.64 KB

Grr.

budda’s picture

The contact tab has gone.

+1

Morbus Iff’s picture

Status: Needs review » Reviewed & tested by the community
Dries’s picture

Status: Reviewed & tested by the community » Needs work

I like the current behavior better:

  1. It provides feedback to the user. He might wonder why some people have a contact form and others not.
  2. It allows the site administrator to send messages regardless of the user's setting. Your patch removes this functionality.
Morbus Iff’s picture

I'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".

Zen’s picture

http://drupal.org/node/41352 might make #1 in Dries' last post (partially) moot. I'll reroll that patch shortly.

-K

webchick’s picture

yeah, this is bugging me. leaving my mark so I can roll a patch later. ;)

webchick’s picture

Status: Needs work » Needs review
FileSize
1.67 KB

This 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.

webchick’s picture

FileSize
2.28 KB

Actually... looks like we can remove some of this access check stuff from contact_mail_user as well, now that this is handled @ hook_menu.

webchick’s picture

Assigned: Unassigned » webchick
webchick’s picture

Title: 'Personal contact form' un-checked still display a 'contact' tab » Hide contact tab for users who have option disabled
Dries’s picture

OK, I agree. Code looks cleaner too! Committed to CVS HEAD. Thanks.

Dries’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)