diff options
-rw-r--r-- | phpBB/includes/notification/manager.php | 7 | ||||
-rw-r--r-- | tests/notification/notification.php | 10 |
2 files changed, 5 insertions, 12 deletions
diff --git a/phpBB/includes/notification/manager.php b/phpBB/includes/notification/manager.php index fa1fd4b81f..9858cda898 100644 --- a/phpBB/includes/notification/manager.php +++ b/phpBB/includes/notification/manager.php @@ -128,13 +128,8 @@ class phpbb_notification_manager $sql = 'SELECT COUNT(n.notification_id) AS unread_count FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt WHERE n.user_id = ' . (int) $options['user_id'] . ' -<<<<<<< HEAD - AND n.unread = 1 - AND nt.notification_type = n.item_type -======= AND n.notification_read = 0 - AND nt.notification_type = n.notification_type ->>>>>>> 5cedca0... [ticket/11103] unread -> notification_read + AND nt.notification_type = n.item_type AND nt.notification_type_enabled = 1'; $result = $this->db->sql_query($sql); $unread_count = (int) $this->db->sql_fetchfield('unread_count', $result); diff --git a/tests/notification/notification.php b/tests/notification/notification.php index e7fd8539ab..cd2080bb4d 100644 --- a/tests/notification/notification.php +++ b/tests/notification/notification.php @@ -20,7 +20,7 @@ class phpbb_notification_test extends phpbb_database_test_case { parent::setUp(); - global $phpbb_root_path, $db, $phpEx; + global $phpbb_root_path, $phpEx; if (!function_exists('set_var')) { @@ -29,7 +29,7 @@ class phpbb_notification_test extends phpbb_database_test_case include_once(__DIR__ . '/ext/test/notification/type/test.' . $phpEx); - $db = $this->db = $this->new_dbal(); + $this->db = $this->new_dbal(); $this->config = new phpbb_config(array( 'allow_privmsg' => true, 'allow_bookmarks' => true, @@ -125,10 +125,8 @@ class phpbb_notification_test extends phpbb_database_test_case public function test_notifications() { - global $db; - // Used to test post notifications later - $db->sql_query('INSERT INTO ' . TOPICS_WATCH_TABLE . ' ' . $db->sql_build_array('INSERT', array( + $this->db->sql_query('INSERT INTO ' . TOPICS_WATCH_TABLE . ' ' . $this->db->sql_build_array('INSERT', array( 'topic_id' => 2, 'notify_status' => NOTIFY_YES, 'user_id' => 0, @@ -171,7 +169,7 @@ class phpbb_notification_test extends phpbb_database_test_case 'forum_name' => 'Your first forum', )); - $db->sql_query('INSERT INTO ' . BOOKMARKS_TABLE . ' ' . $db->sql_build_array('INSERT', array( + $this->db->sql_query('INSERT INTO ' . BOOKMARKS_TABLE . ' ' . $this->db->sql_build_array('INSERT', array( 'topic_id' => 2, 'user_id' => 0, ))); |