Bug #9438
wrong amount of unread private messages
| Status: | Resolved | Start date: | 2010-08-24 | |
|---|---|---|---|---|
| Priority: | Must have | Due date: | ||
| Assignee: | Peter Schuster | % Done: | 100% |
|
| Category: | Messaging | |||
| Target version: | 1.9.2 | |||
| Votes: | 0 |
Description
In class.tx_mmforum_pi3.php in the function count_new_pm() the amount of unread private messages is not correct. The query makes an count, so sql_num_rows will always give 1 row back - wich is not correct:
function count_new_pm($uid) {
if (empty($uid)) $uid = $GLOBALS['TSFE']->fe_user->user['uid'];
$where = 'hidden = 0 AND deleted = 0 AND read_flg = 0 AND mess_type = 0 AND to_uid = '.$GLOBALS['TSFE']->fe_user->user['uid'].$this->getStoragePIDQuery();
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(uid)','tx_mmforum_pminbox',$where,'','',$limit='');
list($count) = $GLOBALS['TYPO3_DB']->sql_num_rows($res); return $count;
}
should be changed into something like:
function count_new_pm($uid) {
if (empty($uid)) $uid = $GLOBALS['TSFE']->fe_user->user['uid'];
$where = 'hidden = 0 AND deleted = 0 AND read_flg = 0 AND mess_type = 0 AND to_uid = '.$GLOBALS['TSFE']->fe_user->user['uid'].$this->getStoragePIDQuery();
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(uid) AS msg_count','tx_mmforum_pminbox',$where,'','',$limit='');
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$count = $row['msg_count'];
return $count;
}
Best regards
Frank
Associated revisions
[#BUGFIX] Wrong amount of unread private messages (fixes #9438, thanks to Frank Daeuble)
[#BUGFIX] Wrong amount of unread private messages (fixes #9438, thanks to Frank Daeuble)
History
Updated by Peter Schuster over 2 years ago
- Category set to Messaging
- Status changed from New to Accepted
- Assignee set to Peter Schuster
- Target version set to 1.9.2
Updated by Peter Schuster over 2 years ago
- Status changed from Accepted to Resolved
- % Done changed from 0 to 100
Applied in changeset r37837.