Merge branch 'ent-10410-Carga-muy-lenta-de-comentarios-de-eventos-en-tyr-saga' into 'develop'

fixed comment loading in event dialog

See merge request 
This commit is contained in:
Matias Didier 2023-02-16 09:34:35 +00:00
commit c6f6a6b9d3

@ -92,6 +92,9 @@ $node_id = (int) get_parameter('node_id', 0);
if ($get_comments === true) {
$event = get_parameter('event', false);
$event_rep = (int) get_parameter('event_rep', 0);
$event_rep = get_parameter_post('event')['event_rep'];
$group_rep = get_parameter_post('event')['group_rep'];
if ($event === false) {
return __('Failed to retrieve comments');
}
@ -99,7 +102,7 @@ if ($get_comments === true) {
$eventsGrouped = [];
// Consider if the event is grouped.
$whereGrouped = '1=1';
if ($event_rep === EVENT_GROUP_REP_EVENTS) {
if ($group_rep === EVENT_GROUP_REP_EVENTS && $event_rep > 1) {
// Default grouped message filtering (evento and estado).
$whereGrouped = sprintf(
'`evento` = "%s"',
@ -120,7 +123,7 @@ if ($get_comments === true) {
(int) $event['id_agentmodule']
);
}
} else if ($event_rep === EVENT_GROUP_REP_EXTRAIDS) {
} else if ($group_rep === EVENT_GROUP_REP_EXTRAIDS) {
$whereGrouped = sprintf(
'`id_extra` = "%s"',
$event['id_extra']
@ -1639,6 +1642,7 @@ if ($get_extended_event) {
$comments = $event['comments'];
$event['similar_ids'] = $similar_ids;
$event['group_rep'] = $group_rep;
if (isset($comments) === false) {
$comments = $event['user_comment'];