[ticket/10711] Duplicate key error on forum_tracks_table

In certain situations, an SQL error DUPLICATE ERROR for KEY 'PRIMARY'
in the forums_track table is produced when marking forums read
(viewforum.php?f=xx&mark=forums).

The problem happens when there are duplicates in the forum_id array.
The solution is to remove those duplicates.

PHPBB3-10711
This commit is contained in:
javiexin 2015-06-13 01:08:18 +02:00
parent 558d604d83
commit 7b026eff79

View file

@ -1258,6 +1258,10 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
{ {
$forum_id = array($forum_id); $forum_id = array($forum_id);
} }
else
{
$forum_id = array_unique($forum_id);
}
$phpbb_notifications = $phpbb_container->get('notification_manager'); $phpbb_notifications = $phpbb_container->get('notification_manager');