Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I don't think the reply form should be shown on the message page if any of the users in the conversation have closed their accounts or been blocked. I realize that one could also argue that the reply form should not be shown only if all of the users have been blocked, since the conversation could continue without the blocked users.
This feature request is related to the issue here:
https://drupal.org/node/834706
Comment | File | Size | Author |
---|---|---|---|
#1 | privatemsg-hide-reply-form-if-user-blocked-2008096-1.patch | 1 KB | ptmkenny |
Comments
Comment #1
ptmkenny CreditAttribution: ptmkenny commentedComment #2
BerdirThat code is specific to users, that doesn't work, a recipient could also be a role.
What we need to check and what I thought we already did is simply if there are any valid recipients that we can write to.
If you look at privatemsg_form_reply(), you can see that it already does that and it even has logic to display the reasons why those users are blocked. So if the form is still displayed, you need to check why the check there isn't working.
Comment #3
ptmkenny CreditAttribution: ptmkenny commentedOk, thanks for the comment. I missed the function call that performed validation.
I tried implementing this a different way by adding the following lines to _privatemsg_get_allowed_recipients() to make sure that the user account isn't blocked:
However, the reply form is still shown because of this code:
If I delete the line $usercount++, the reply form is hidden correctly. Why is the user added as the only recipient?
Comment #4
ptmkenny CreditAttribution: ptmkenny commentedClosed as duplicate as per this comment: https://drupal.org/node/834706#comment-7493932