fix: [relatedEvent:view] catch if number of correlation cannot be found

pull/4570/head
mokaddem 2019-06-21 11:42:21 +02:00
parent ea7329063f
commit 96bc938ae1
3 changed files with 5 additions and 2 deletions

View File

@ -1086,7 +1086,6 @@ class EventsController extends AppController
}
$event = $results[0];
$attributeTagsName = $this->Event->Attribute->AttributeTag->extractAttributeTagsNameFromEvent($event, 'both');
$this->set('attributeTags', array_values($attributeTagsName['tags']));
$this->set('attributeClusters', array_values($attributeTagsName['clusters']));

View File

@ -18,7 +18,10 @@
</tr>
<tr>
<td style="line-height: 14px; padding-left: 2px;">
<i><?php echo h($related['date']); ?></i><b style="margin-left: 5px; float: right;" title="<?php echo __(sprintf('This related event contains %s unique correlation(s)', h($relatedEventCorrelationCount[$related['id']]))); ?>"> <?php echo h($relatedEventCorrelationCount[$related['id']]) ?></b>
<i><?php echo h($related['date']); ?></i>
<?php if (isset($relatedEventCorrelationCount[$related['id']])): ?>
<b style="margin-left: 5px; float: right;" title="<?php echo __(sprintf('This related event contains %s unique correlation(s)', h($relatedEventCorrelationCount[$related['id']]))); ?>"> <?php echo h($relatedEventCorrelationCount[$related['id']]) ?></b>
<?php endif; ?>
</td>
</tr>
</tbody>

View File

@ -104,6 +104,7 @@
<li class="<?php echo $i > $display_threshold ? 'correlation-expanded-area' : ''; ?>" style="<?php echo $i > $display_threshold ? 'display: none;' : ''; ?>">
<?php echo $this->element('/Events/View/related_event', array(
'related' => $relatedEvent['Event'],
'relatedEventCorrelationCount' => array(),
'href_url' => $baseurl . '/servers/previewEvent/' . $server['Server']['id']
)); ?>
</li>