Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-12493

User can not send PMs to users with PMs disabled, but PM button is visible on posts

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-b2
    • Fix Version/s: 3.1.0-b4
    • Labels:
      None

      Description

      After changing in Build # 1450 phpBB ticket PHPBB3-8323 users can not to other user send PM. It appears the error message 'Some users couldn’t be added as they have disabled private message receipt.' and the PM is not sent.

        Issue Links

          Activity

          Hide
          nickvergessen Joas Schilling added a comment -

          Okay fresh install helped me to reproduce this:
          ucp_pm_compose.php:
          The resulting query looks like:

          SELECT user_id, user_allow_pm
          FROM phpbb12493_users
          WHERE user_id = 49
          	AND (user_type = 1
          		AND user_inactive_reason = 3)
          	OR user_allow_pm = 0

          but should be:

          SELECT user_id, user_allow_pm
          FROM phpbb12493_users
          WHERE user_id = 49
          	AND (
          		(user_type = 1 AND user_inactive_reason = 3)
          		OR user_allow_pm = 0
          	)

          So the WHERE user_id also applies to the user_allow_pm = 0 case

          Show
          nickvergessen Joas Schilling added a comment - Okay fresh install helped me to reproduce this: ucp_pm_compose.php: The resulting query looks like: SELECT user_id, user_allow_pm FROM phpbb12493_users WHERE user_id = 49 AND (user_type = 1 AND user_inactive_reason = 3) OR user_allow_pm = 0 but should be: SELECT user_id, user_allow_pm FROM phpbb12493_users WHERE user_id = 49 AND ( (user_type = 1 AND user_inactive_reason = 3) OR user_allow_pm = 0 ) So the WHERE user_id also applies to the user_allow_pm = 0 case
          Hide
          wintstar wintstar added a comment -

          User2 has setting "Other members I may send private messages" is set to Yes.

          Show
          wintstar wintstar added a comment - User2 has setting "Other members I may send private messages" is set to Yes.
          Hide
          aleha aleha added a comment -

          I have implemented nickvergessen's solution which fixes the problem. I will soon create a PR.

          Show
          aleha aleha added a comment - I have implemented nickvergessen's solution which fixes the problem. I will soon create a PR.
          Hide
          wintstar wintstar added a comment -
          Show
          wintstar wintstar added a comment - Patch works => https://github.com/phpbb/phpbb/pull/2421/files#r12377204
          Hide
          ividyon ividyon [X] (Inactive) added a comment -

          I can confirm that the issue was fixed using the following change: https://github.com/phpbb/phpbb/pull/2421/files#r12377204

          Show
          ividyon ividyon [X] (Inactive) added a comment - I can confirm that the issue was fixed using the following change: https://github.com/phpbb/phpbb/pull/2421/files#r12377204

            People

            • Assignee:
              nickvergessen Joas Schilling
              Reporter:
              wintstar wintstar
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development