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

Unread PM Count Allowed to Go Negative

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 3.1.6
    • Fix Version/s: None
    • Component/s: Private Messages (PM)
    • Labels:
      None
    • Environment:
      MySQL 10.0.22-MariaDB

      Description

      I don't know how it occurred, but I currently have a negative unread / new Private Message count. It isn't really a big deal, but it won't go away until either I reset the count manually or possibly get a new PM or two.

      It seems like this could be a simple cosmetic fix in includes/functions.php

      Find:

      'PRIVATE_MESSAGE_COUNT' => (!empty($user->data['user_unread_privmsg'])) ? $user->data['user_unread_privmsg'] : 0,
      'S_USER_NEW_PRIVMSG' => $user->data['user_new_privmsg'],
      'S_USER_UNREAD_PRIVMSG' => $user->data['user_unread_privmsg'],
      

      Change to:

      'PRIVATE_MESSAGE_COUNT' => (!empty($user->data['user_unread_privmsg']) && $user->data['user_unread_privmsg'] > 0) ? $user->data['user_unread_privmsg'] : 0,
      'S_USER_NEW_PRIVMSG' => ($user->data['user_new_privmsg'] > 0) ? $user->data['user_new_privmsg'] : 0,
      'S_USER_UNREAD_PRIVMSG' => ($user->data['user_unread_privmsg'] > 0) ? $user->data['user_unread_privmsg'] : 0,
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              Ectoman AJ Quick
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: