Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-14780

PM inbox group_message_limit error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.2.0
    • 3.2.0-RC1
    • PHP 5.6.20, MySQL 5.5.49, chrome 52

      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;

            Crizzo Crizzo
            Jeroen Coopmans Jeroen Coopmans [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: