From 89a02464609b729fd5778e11aae3aef24bb2a550 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 18 Mar 2018 13:49:15 +0100 Subject: [PATCH] Reset unread article count on delete/restore --- .../files/lib/data/article/ArticleAction.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wcfsetup/install/files/lib/data/article/ArticleAction.class.php b/wcfsetup/install/files/lib/data/article/ArticleAction.class.php index ec9c7dcf78..0b0269ee69 100644 --- a/wcfsetup/install/files/lib/data/article/ArticleAction.class.php +++ b/wcfsetup/install/files/lib/data/article/ArticleAction.class.php @@ -332,6 +332,11 @@ class ArticleAction extends AbstractDatabaseObjectAction { $this->unmarkItems(); + // reset storage + if (ARTICLE_ENABLE_VISIT_TRACKING) { + UserStorageHandler::getInstance()->resetAll('unreadArticles'); + } + return ['objectIDs' => $this->objectIDs]; } @@ -354,6 +359,11 @@ class ArticleAction extends AbstractDatabaseObjectAction { $this->unmarkItems(); + // reset storage + if (ARTICLE_ENABLE_VISIT_TRACKING) { + UserStorageHandler::getInstance()->resetAll('unreadArticles'); + } + return ['objectIDs' => $this->objectIDs]; } -- 2.20.1