From 3d67f2badb2c401c8d8d827f9d718de6e1840105 Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+github@gmail.com>
Date: Wed, 2 Mar 2022 10:17:48 +0100
Subject: [PATCH] store object visits for each news item, fixes #746

---
 lib/classes/MyRealmModel.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/classes/MyRealmModel.php b/lib/classes/MyRealmModel.php
index 2dd81a42943..522dc8b766c 100644
--- a/lib/classes/MyRealmModel.php
+++ b/lib/classes/MyRealmModel.php
@@ -511,6 +511,11 @@ class MyRealmModel
                     SELECT eval_id, :user_id, '-2', :timestamp, 0
                     FROM eval_range
                     WHERE range_id = :id
+                  ) UNION (
+                    SELECT `news_id`, :user_id, `pluginid`, :timestamp, 0
+                    FROM `news_range`
+                    JOIN `plugins` ON (`pluginclassname` = 'CoreOverview')
+                    WHERE `range_id` = :id
                   )
                   ON DUPLICATE KEY UPDATE last_visitdate = IFNULL(visitdate, 0), visitdate = :timestamp";
         $statement = DBManager::get()->prepare($query);
-- 
GitLab