fix: [enrichment view] Displaying Tags only if not empty (error otherwise)

pull/4584/head
chrisr3d 2019-06-17 17:19:59 +02:00
parent e85513307d
commit 5dfb024f26
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 14 additions and 12 deletions

View File

@ -55,18 +55,20 @@
}
$objects_string = $objects_count > 1 ? ' Objects)' : 'Object)';
$count = $attributes_count . ' (' . $objects_count . $objects_string;
$table_data[] = array(
'key' => __('Tags'),
'html' => sprintf(
'<span class="eventTagContainer">%s</span>',
$this->element('ajaxTags', array(
'event' => $event,
'tags' => $event['Tag'],
'tagAccess' => ($isSiteAdmin || $me['org_id'] == $event['Event']['orgc_id']),
'static_tags_only' => 1
))
)
);
if (!empty($event['Tag'])) {
$table_data[] = array(
'key' => __('Tags'),
'html' => sprintf(
'<span class="eventTagContainer">%s</span>',
$this->element('ajaxTags', array(
'event' => $event,
'tags' => $event['Tag'],
'tagAccess' => ($isSiteAdmin || $me['org_id'] == $event['Event']['orgc_id']),
'static_tags_only' => 1
))
)
);
}
$table_data[] = array('key' => __('#Resolved Attributes'), 'value' => $count);
echo $this->element('genericElements/viewMetaTable', array('table_data' => $table_data));
}