From 5f91ebf20d43a854bb457fc22ef5e0f11d965067 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sun, 18 Dec 2016 12:35:09 -0800 Subject: [PATCH] Issue #2162: Clear the news item cache after submitting a comment so the comment counter remains accurate. --- e107_plugins/news/e_event.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/e107_plugins/news/e_event.php b/e107_plugins/news/e_event.php index ca368946b..6a440788d 100644 --- a/e107_plugins/news/e_event.php +++ b/e107_plugins/news/e_event.php @@ -42,13 +42,14 @@ class news_event // plugin-folder + '_event' { if($data['comment_type'] !== 'news' && !empty($data['comment_type'])) { - file_put_contents(e_LOG."news.event.log", print_r($data,true)); return false; } if(!empty($data['comment_item_id'])) { - e107::getDb()->update("news", "news_comment_total=news_comment_total+1 WHERE news_id=".intval($data['comment_item_id'])); + $id = intval($data['comment_item_id']); + e107::getDb()->update("news", "news_comment_total=news_comment_total+1 WHERE news_id=".$id); + e107::getCache()->clear('news_php_extend_'.$id.'_'); } }