From 38f3b09645bd90987e1493a36331c017af24a83b Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Tue, 10 Dec 2013 12:22:55 +0000 Subject: [PATCH] 2013-12-10 Sergio Martin * include/functions_events.php: Fix storing of event comments in metaconsole and shot the event comments more recent first. Incident #440 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9199 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++++ pandora_console/include/functions_events.php | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5ec3d35cfe..9e4d0abbc5 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2013-12-10 Sergio Martin + + * include/functions_events.php: Fix storing of event + comments in metaconsole and shot the event comments more + recent first. + Incident #440 + 2013-12-09 Sergio Martin * include/styles/pandora.css: Fix styles in group view diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index c999285006..0f1c402de0 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -547,7 +547,7 @@ function events_comment ($id_event, $comment = '', $action = 'Added comment', $m if (is_array($id_event)) { $first_event = reset($id_event); } - $event_comments = db_get_value('user_comment', 'tevento', 'id_evento', $first_event); + $event_comments = db_get_value('user_comment', $event_table, 'id_evento', $first_event); $event_comments_array = array(); if ($event_comments == '') { @@ -2259,6 +2259,9 @@ function events_page_comments ($event) { // If comments are not stored in json, the format is old $event_comments_array = json_decode($event_comments, true); + // Show the comments more recent first + $event_comments_array = array_reverse($event_comments_array); + if (is_null($event_comments_array)) { $comments_format = 'old'; }