Wrong count of new messages at menu ("Inbox (xxx)") even though there's no unread messages in the Inbox

Created on 6 November 2009, about 15 years ago
Updated 4 August 2023, over 1 year ago

At the privatemsg 5.x - 3.0 module it shows some new messages at menu ("Inbox (xxx)") even though there's no unread messages in the Inbox. It does count of messages by the whole privatemsg table at line 2101:

function _privatemsg_get_new_messages($uid = 0) {
...
    $cache[$uid] = (int)db_result(db_query('SELECT COUNT(*) FROM {privatemsg} WHERE recipient = %d AND newmsg = 1 AND recipient_del = 0', $uid));
...
}

but it looks for unread messages only for users that are exist at line 713:

function privatemsg_list($uid = NULL) {
...
  $sql1 = "SELECT id, subject, p.timestamp, u.uid, u.name, newmsg, type FROM {privatemsg} p INNER JOIN {users} u ON ";
...
}

( INNER JOIN {users} there ).

But if some users were deleted already, there are some unread messages from deleted users and these messages aren't shown at folders.

Can you fix this please?

πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine vito_a

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024