1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 06:07:32 +02:00

Issue #2162: Clear the news item cache after submitting a comment so the comment counter remains accurate.

This commit is contained in:
Cameron
2016-12-18 12:35:09 -08:00
parent 0203a56fd2
commit 5f91ebf20d

View File

@@ -42,13 +42,14 @@ class news_event // plugin-folder + '_event'
{ {
if($data['comment_type'] !== 'news' && !empty($data['comment_type'])) if($data['comment_type'] !== 'news' && !empty($data['comment_type']))
{ {
file_put_contents(e_LOG."news.event.log", print_r($data,true));
return false; return false;
} }
if(!empty($data['comment_item_id'])) 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.'_');
} }
} }