mirror of https://github.com/MISP/MISP
fix: [enrichment] Setting importComment value before going to the view
- Saving a variable & will avoid issues when reusing the view for import modulespull/4584/head
parent
2692efd265
commit
e2561f0022
|
@ -5131,11 +5131,11 @@ class EventsController extends AppController
|
|||
if (empty($attributes) && empty($objects)) {
|
||||
$this->__handleSimplifiedFormat($attribute, $module, $options, $result, $type);
|
||||
} else {
|
||||
$this->set('attributeValue', $attribute[0]['Attribute']['value']);
|
||||
$this->set('module', $module);
|
||||
$event = array('Event' => $attribute[0]['Event']);
|
||||
$event['Attribute'] = $attributes;
|
||||
$event['Object'] = $objects;
|
||||
$importComment = !empty($result['comment']) ? $result['comment'] : $attribute[0]['Attribute']['value'] . __(': Enriched via the ') . $module . ($type != 'Enrichment' ? ' ' . $type : '') . ' module';
|
||||
$this->set('importComment', $importComment);
|
||||
if ($attribute[0]['Object']['id']) {
|
||||
$object_id = $attribute[0]['Object']['id'];
|
||||
$initial_object = $this->Event->Object->find('first', array(
|
||||
|
|
|
@ -15,9 +15,6 @@
|
|||
'style' => 'display:none;',
|
||||
'value' => ''
|
||||
));
|
||||
if (!isset($importComment)) {
|
||||
$importComment = $attributeValue . ': Enriched via the ' . $module . ' module';
|
||||
}
|
||||
echo $this->Form->input('default_comment', array(
|
||||
'label' => false,
|
||||
'type' => 'text',
|
||||
|
|
Loading…
Reference in New Issue