mirror of https://github.com/MISP/MISP
fix: [modules results] Fixed the query to find the uuid of the attribute used as input of a misp-module
- With `Attribute.object_id => 0`, the query did only return attributes outside of a MISP object - This was causing issues with references between the MISP objects returned by the modules and the attribute used as input to the module. Those references were visible in the module results preview, but skipped then after the submit button is pressed. - The references are now correctly handledpull/7420/head
parent
49cca7256d
commit
7573c5abb9
|
@ -6299,12 +6299,19 @@ class Event extends AppModel
|
|||
} else {
|
||||
$failed_attributes++;
|
||||
$lastAttributeError = $this->Attribute->validationErrors;
|
||||
$original_uuid = $this->Object->Attribute->find('first', array(
|
||||
'conditions' => array('Attribute.event_id' => $id, 'Attribute.object_id' => 0, 'Attribute.deleted' => 0,
|
||||
'Attribute.type' => $attribute['type'], 'Attribute.value' => $attribute['value']),
|
||||
'recursive' => -1,
|
||||
'fields' => array('Attribute.uuid')
|
||||
));
|
||||
$original_uuid = $this->Object->Attribute->find(
|
||||
'first',
|
||||
array(
|
||||
'conditions' => array(
|
||||
'Attribute.event_id' => $id,
|
||||
'Attribute.deleted' => 0,
|
||||
'Attribute.type' => $attribute['type'],
|
||||
'Attribute.value' => $attribute['value']
|
||||
),
|
||||
'recursive' => -1,
|
||||
'fields' => array('Attribute.uuid')
|
||||
)
|
||||
);
|
||||
if (!empty($original_uuid)) {
|
||||
$recovered_uuids[$attribute['uuid']] = $original_uuid['Attribute']['uuid'];
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue