#8766 Fixed event comments

This commit is contained in:
Daniel Maya 2022-04-04 16:02:26 +02:00
parent ad957c5a72
commit 4a6ab6ce95
2 changed files with 4 additions and 1 deletions

View File

@ -136,7 +136,7 @@ if ($get_comments === true) {
// Default grouped message filtering (evento and estado).
$whereGrouped = sprintf(
'`evento` = "%s" AND `estado` = "%s"',
io_safe_output($event['evento']),
$event['evento'],
$event['estado']
);
// If id_agente is reported, filter the messages by them as well.

View File

@ -2299,6 +2299,7 @@ function events_comment(
$comments_format = 'new';
} else {
// If comments are not stored in json, the format is old.
$event_comments[0]['user_comment'] = str_replace(["\n", '&#x0a;'], '<br>', $event_comments[0]['user_comment']);
$event_comments_array = json_decode($event_comments[0]['user_comment']);
if (empty($event_comments_array) === true) {
@ -5229,6 +5230,8 @@ function events_page_comments($event, $ajax=false, $groupedComments=[])
$comm = $comm['user_comment'];
}
$comm = str_replace(["\n", '&#x0a;'], '<br>', $comm);
$comments_array[] = io_safe_output(json_decode($comm, true));
}