How can I remove the "Message" tab on the user page? I tried menu_alter on a custom module but nothing. I already have the Messages link on my primary links so I don't see the use of another one on the user profile page.

I seriously think there should be an option to disable this on the settings page.

CommentFileSizeAuthor
#6 privatemsg_readall_invisible_tab.patch1.69 KBberdir

Comments

berdir’s picture

Status: Active » Closed (won't fix)

That link is not added by privatemsg.module, it comes from the Messaging module "Simple messaging". Chances are quite high that you don't want that enabled at all...

entr3p’s picture

Status: Closed (won't fix) » Active

I don't have that module installed at all.

That tab IS added by Privatemsg. It goes to "/user/*/messages" which pretty much goes to the same page as "messages" but without the ability to send messages.

The "messages" tab is located right next to the "Edit" tab in the profile page.

How the tabs look like on the profile page:

"View" "Edit" "Messages" --> Leads to messages page of Privatemsg.

EDIT#
I was able to disable the "Messages" tab by adding this to a custom module which uses menu_alter:
$items['user/%/messages']['type'] = MENU_CALLBACK;

It would be nice if there can be a settings to turn it off/on so that newbies don't have to go on to something too "advanced" for something so simple.

naheemsays’s picture

It was added by #298502: Better access to another user's messages and having the ability to turn it off for your own user may be a good idea.

berdir’s picture

Uhm, sorry for reacting too fast, forgot that one...

I'm wondering, do we really want to display that link to users (those without read all permission)? Displaying that doesn't help much since all links point to /messages anyway, they can reach that url only manually, so...

I know that there are feature requests that want exactly this, but the thing is that it is very limited and still needs /messages, it can only be accessed manually. Maybe #561036: Conflicting URL scheme will make it possible to *move* the link below /user/%user (not the current patch, but the way i'd like to implement it).

naheemsays’s picture

I have no real concerns either way - I think it can be got rid of pretty easily - delete the privatemsg_user_tab_access() function and then make the access callback do a straightforward access check.

berdir’s picture

Status: Active » Needs review
StatusFileSize
new1.69 KB

The attached patch should get hide the messages unless you have read all private messages permission.

Note that you need to visit admin/build/modules to rebuild the menu.

berdir’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Fixed

Fixed in 6.x-1.x-dev and 7.x-1·x-dev.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Ashraf Amayreh’s picture

Component: User interface » Code
Status: Closed (fixed) » Active

Out of curiosity. How was removing the tab a good idea? I know many users might want to put that URL wherever they want without being restricted to a tab.

But in a normal installation, if I go to some user's profile and send him a private message, then that user logs in, he'll see a message "1 unread message" or something. If he refreshes his browser, no more message notification and nowhere he can go to see his messages since there's no tab or anything in the UI to take him to his inbox... Or do I totally understand this wrong?

Ashraf Amayreh’s picture

Status: Active » Closed (fixed)

Spoke too soon. Just saw the block. Although I would think some message after installation would be quite helpful to guide the normal user to it.