Recently I was showing off a newly tailored Drupal site to a few *non-web-savvy* people and they brought up a very good point. Why the heck does Drupal show the contact tab when I'm viewing my own profile?

Sure there might be limited cases for why you might want to contact yourself, but overall, this is *very* confusing, a bit of a usability blow, IMO.

This patch fixes that confusion.

(hopefully it can be backported to 4.7 too, usability fix ;-))

Comments

dries’s picture

I find it useful to test how it works, to setup my inbox filters, etc. That said, if the majority of the people think it's confusing, I'd be happy to commit this patch.

m3avrck’s picture

Agreed, I can see uses for us "techies" but out of a group of 3 other people (very well educated, very smart), they found the contact tab on their personal profile tab confusing and not needed at all.

Maybe this should rather be another permission, "contact self" so it can be turned off for certain roles?

dries’s picture

I'd vote against another permission. I think we just have to make a decision.

pwolanin’s picture

StatusFileSize
new1.7 KB

I think this patch is a good idea, though maybe should include an addition to the contact.module help text (such as attached patch)?

Surely any site admin can create a dummy account if they want to log in and contact themselves for test purposes.

m3avrck’s picture

StatusFileSize
new2.43 KB

Good idea pwolanin about the help text. And Dries, I agree, another permission is really not needed but just wanted to throw that out there :-)

Updated patch, ready to go.

webchick’s picture

StatusFileSize
new873 bytes

A of couple minor nits on the help text:

1. You should avoid having to escape stuff whenever possible, so that string should actually go in double quotes
2. You actually will only see it in another user's profile, if they have the contact feature enabled

I'm thinking though, why don't we instead always show it for uid 1 (satisfies the debugging use case, which is valid imo, and they're used to seeing everything anyway) and not for anyone else (satisfies the "why can I contact myself?" case for non-technical users)?

Here's a patch which takes that approach.

webchick’s picture

StatusFileSize
new2.39 KB

Oops. Forgot to fix the help text.

As a side note, somewhere along the way the help text for the contact module became totally inconsistent with the rest of the core modules' help files... sigh. :( I'll roll a separate patch for that, though.

m3avrck’s picture

I'm cool with that :-)

dries’s picture

I'd get rid of the ($user->uid == 1) check.

webchick’s picture

StatusFileSize
new2.4 KB

Fair enough. :)

This patch includes the fixed help text, and Ted's original approach.

adixon’s picture

Thanks, i love useability (for other people mostly). But couldn't we just change your patch from

+      if ($user->uid != $account->uid && ($account->contact || user_access('administer users'))) {

to

+      if (($user->uid != $account->uid && $account->contact) || user_access('administer users')) {

In other words, 'administer users' allows you to send emails to everyone else, so you might as well allow you to send to yourself.

webchick’s picture

StatusFileSize
new2.4 KB

I was just thinking that this morning, actually... since someone with administer user privileges can already see contact tabs when they shouldn't (like on users who have that option disabled), and since you'd be less likely to give those privileges away to users who would be confused by the presence of the tab, I think this also makes sense.

Exact same patch, just switched around the logic per adixon's comments. Either this one or #10 should be good to go, depending on what approach is preferred.

m3avrck’s picture

I'm cool with either one since they both prevent normal users from being able to contact themself :-)

dries’s picture

Status: Needs review » Fixed

Great. webchick's patch gives us the best of both worlds. Committed to CVS HEAD.

pwolanin’s picture

Will this be backported to 4.7 too? Could certainly be considered a UI bug.

m3avrck’s picture

*/me pokes killes*

usability fix for 4.7 ;-)

Anonymous’s picture

Status: Fixed » Closed (fixed)