MyBB Community Forums

Full Version: [F] [PostgreSQL]Failure in portal.php [C-Michael83]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In the portal.php is a failure at line 200, where the unread messages are counted.
The SQL-statement trys to sum every field, which is incorrect, because you can only sum one field.
And the command IF does not exists, but the statement CASE WHEN ... THEN ... ELSE ... END (case, when, ...)

So the correct statement should be like
$query = $db->simple_select("privatemessages", "COUNT(*) AS pms_unread", "uid='".$mybb->user['uid']."' AND CASE WHEN status = '0' AND folder = '0' THEN TRUE ELSE FALSE END");
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group