Two quick questions with, I hope, quick answers. Haven't found either on the issue queue. First post, apologies if my syntax is newbie-ish.
1. The Private Messages module adds a "Messages" link to Navigation, which links to "base_path/messages" and works just fine. There is also a link "Messages" added to the User Profile tab which links to "base_path/user/$uid/messages" and which gives a page with "No pending messages," even when there are viable pending messages (shown in Navigation link, in fact). Have I made a mistake in my settings, or is there a way to redirect this tab link appropriately? Or has this tab link been created by another module, in which case...never mind...too many new installs...
2. Is there any way to shut down the "Send this user a message" link when user is viewing their own profile page?
This is very minor stuff in a very impressive module, but they are head-scratchers.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | privatemsg_display_self_bugfix.patch | 930 bytes | berdir |
| #11 | privatemsg_display_self3.patch | 2.94 KB | berdir |
| #10 | privatemsg_display_self2.patch | 2.86 KB | berdir |
| #6 | admin_settings.png | 42.06 KB | berdir |
| #4 | privatemsg_display_self.patch | 4.25 KB | berdir |
Comments
Comment #1
berdirFirst, do not use the 2.x version, use 1.x-dev or 1.0-rc3.
Hm, is it possible that this is from the messaging module? Privatemsg does not yet have such a thing...
You can remove it with hook_user in a custom module with a higher weight than privatemsg, but that is not a nice solution. It should be easy to fix this, I already did it in a patch once, but litwol requested to remove it from that patch. (that does not mean he is against removing it, just that we/he didn't wanted to change how it works in a patch that just refactored internal functions).
Comment #2
drupup commented1. Ah, it was Simple Messaging that created the tab. Module overload! So I guess this falls under the FYI category....it's possible for a user to have two different links saying "Messages" that go to different places, if the site designer isn't careful about which module boxes he checks.
2. Perhaps make this something you can turn on/off with a checkbox in settings? I can see both why you would and wouldn't want this feature available. Pick one or the other and some people will be dissatisfied.
Thanks for the response. Overall, this module is just outstanding. If I can figure out Rules well enough, and figure out how to integrate private messaging into Rules, this will be a great way to keep users up to date on their site use without bombarding them with e-mails.
Comment #3
berdirShould be easy to add, but I don't have time to write a patch at the moment. If you (or someone else who whants the feature) know a bit PHP, feel free to do so, you only have to add three things:
1. Add a setting to the admin form, you can pretty much copy paste an existing option and change the name, description and so on.
2. Add an additional check in http://blog.worldempire.ch/api/function/privatemsg_get_link inside the foreach, should look like:
3. remove the variable in privatemsg_uninstall().
Comment #4
berdirImplemented what I described above...
I also tried to clean up our settings page a bit, any feedback is welcome ;) I even thought about hiding the currently useless template setting, not sure...
Comment #5
drupup commentedI was about to say it hadn't worked...then I realized you put it in the setting panel as a checkbox. I'm glad I looked one more time! I can see there are situations where peopel would want the function, so a checkable choice is best.
Yeah, there's no way I would have been able to put that code together, I'm just not at that level of Drupalicity yet.
I agree...the "default view" radio button doesn't serve much purpose, beyond that the settings panels are marvelously uncluttered. This is just a very well-executed module all around.
Comment #6
berdirUpdating title and adding a screenshot of the updated admin screen. The List fieldset is collapsed by default.
Comment #7
Plazmus commentedI don't see the point keeping as option 'Display "Send this user a message" links for themself' for me it's quite obvious that anyone will not send messages to themselves, will you ?
Comment #8
litwol commentedThat is a big and baseless assumption. that feature exist because it was explicitly requested by those people that desire to send messages to themselves.
Comment #9
Plazmus commentedNot having this link in own profile is more "natural", just have a look at Facebook or any other website (at least all that I know) don't have it and if people wants to send message to themselves can always go to 'messages/new'.
However if there is someone who will need this functionality let's keep it.
I tested this patch for a while and works as expected.
Comment #10
berdirRe-rolled, removed admin form cleanup stuff. Patch only applies against 2.x-dev.
Comment #11
berdirNew patch moves the setting into the new fieldset, no other changes, will commit this soon.
Comment #12
berdirCommited to 6.x-2.x, needs to be ported to 7.x-1.x.
Comment #13
berdirPorted and Commited to 7.x but I found a bug in the patch while porting which is already fix in 7.x but not yet in 6.x-2.x. Because of missing brackets, $url is empty. The attached patch fixes that, I'm going to commit that now.
Comment #14
berdirCommited.
Comment #16
boran commentedIf would be nice to have a stable release with these fixes...
I'm reluctant to use (yet another :-) dev release in production... I need to hide the "Send this user a message" on one's own profile.
The quickest way was in privatemsg_user() to change:
if ($url = privatemsg_get_link(array($account))) {
to
if ($url = privatemsg_get_link(array($account)) && ($user->uid != $account->uid)) {