From 7b026eff7980535488fb60e9ecee45e3eb3ac819 Mon Sep 17 00:00:00 2001 From: javiexin Date: Sat, 13 Jun 2015 01:08:18 +0200 Subject: [PATCH] [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 --- phpBB/includes/functions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 573df9e55d..c19f32088c 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1258,6 +1258,10 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ { $forum_id = array($forum_id); } + else + { + $forum_id = array_unique($forum_id); + } $phpbb_notifications = $phpbb_container->get('notification_manager');