I found 2 problems with the "Send this user a private message" link:

  1. It appears no matter what, even if the user has no "write and view messages" permission.
  2. It appears in the current user profile, that way the user can send a message to self, which is not permitted on the regular new message form (it creates a duplicated thread)

Issue fork privatemsg-3589318

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lemartialou created an issue. See original summary.

ivnish made their first commit to this issue’s fork.

ivnish’s picture

Assigned: Unassigned » ivnish

  • ivnish committed 3a291cfd on 2.0.x
    fix: #3589318 Send this user a private message bug
    
    By: lemartialou
    By:...
ivnish’s picture

Assigned: ivnish » Unassigned
Status: Active » Fixed

Fixed both. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

lemartialou’s picture

Thank you! It almost works, but now it seems that we have a caching problem...

Minimal way to reproduce:
- install drupal 11.3.9
- install and enable privatemsg
- authenticated user: "view user information"
- authenticated user: "write and view messages"
- create user1
- create user2

Now,
- Login as user1
- On user1's profile page no send link => good
- Go to user2's profile page
- you get the send link => good

Now,
- Login as user2
- On user2's profile page the send link is shown => not good
- Go to user1's profile page
- the send link is not shown => not good

Now,
- Rebuild the cache

Still as user2:
- Refresh user1's profile page
- now the send link is shown => good
- go back to user2's profile page
- now the send link is not shown => good

BUT
- Login as user1 again
- send link is shown on user1's profile => not good
- send link is not shown on user2's profile => not good

So you can rebuild the cache, it will be good for user1 but not for user2... well I hope it's clear and you understand what's happening here.

Good luck! I'm cheering for you from the bench! ^^

lemartialou’s picture

Status: Fixed » Active

ivnish’s picture

Assigned: Unassigned » ivnish

  • ivnish committed c32fabdb on 2.0.x
    fix: #3589318 Send this user a private message
    
    By: lemartialou
    By:...
ivnish’s picture

Assigned: ivnish » Unassigned
Status: Active » Fixed

Nice catch! Thanks! Could you test again?

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

lemartialou’s picture

Ok, I've tested a bunch of scenarios, it seems that now the link behaves perfectly!
Well done! Your reactivity is amazing!
Thanks again! :)

Status: Fixed » Closed (fixed)

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