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

PM inbox group_message_limit error

    Details

      Description

      I cannot increase the maximum number of private messages for the inbox. A bit of digging led me to this function in \includes\functions_privmsgs.php

      function phpbb_get_max_setting_from_group(\phpbb\db\driver\driver_interface $db, $user_id, $setting)
      {
      if ($setting !== 'max_recipients' && $setting !== 'message_limit')

      { throw new InvalidArgumentException('Setting "' . $setting . '" is not supported'); }

      // Get maximum number of allowed recipients
      $sql = 'SELECT MIN(g.group_' . $setting . ') as min_setting, MAX(g.group_' . $setting . ') as max_setting
      FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . ' ug
      WHERE ug.user_id = ' . (int) $user_id . '
      AND ug.user_pending = 0
      AND ug.group_id = g.group_id';
      $result = $db->sql_query($sql);
      $row = $db->sql_fetchrow($result);
      $db->sql_freeresult($result);
      $max_setting = (int) $row['max_setting'];
      $min_setting = (int) $row['min_setting'];

      return ($min_setting > 0) ? $max_setting : 0;
      }

      When I execute the SQL query manually the result for $min_setting is 0, and $max_setting is 2000

      I suggest to change the last line in the function to:

      return ($min_setting > 0) ? $min_setting : $max_setting;

        Attachments

          Activity

            People

            • Assignee:
              Crizzo Crizzo
              Reporter:
              Jeroen Coopmans Jeroen Coopmans [X] (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: