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:
commit
fb2b261698
|
@ -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 '';
|
||||
|
|
Loading…
Reference in New Issue