fix: [enrichment] Setting importComment value before going to the view

- Saving a variable & will avoid issues when reusing
  the view for import modules
pull/4584/head
chrisr3d 2019-05-02 11:45:43 +02:00
parent 2692efd265
commit e2561f0022
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
2 changed files with 2 additions and 5 deletions

View File

@ -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(

View File

@ -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',