Merge branch 'ent-10631-15172-problema-con-carga-de-comentarios-en-tabla-de-eventos' into 'develop'

fix comments events pandora_enterprise#10631

See merge request artica/pandorafms!5694
This commit is contained in:
Daniel Rodriguez 2023-04-18 11:01:14 +00:00
commit fb2b261698
1 changed files with 12 additions and 15 deletions

View File

@ -7057,23 +7057,20 @@ function ui_print_comments($comments)
}
}
$last_comment = [];
foreach ($comments_array as $comm) {
// Show the comments more recent first.
if (is_array($comm)) {
$order_utimestamp = array_reduce(
$comm,
function ($carry, $item) {
$carry[$item['utimestamp']] = $item;
return $carry;
}
);
$order_utimestamp = array_reduce(
$comments_array,
function ($carry, $item) {
foreach ($item as $k => $v) {
$carry[$v['utimestamp']] = $v;
}
$key_max_utimestamp = max(array_keys($order_utimestamp));
$last_comment = $order_utimestamp[$key_max_utimestamp];
return $carry;
}
}
);
$key_max_utimestamp = max(array_keys($order_utimestamp));
$last_comment = $order_utimestamp[$key_max_utimestamp];
if (empty($last_comment) === true) {
return '';