mirror of https://github.com/MISP/MISP
fix: [analyst-data:attachData] Make sure to also load child notes and opinions
Changed the old behavior: Before we were loading 3 children. Now, we only load 1 by default.pull/9665/head
parent
94dd4fa093
commit
3d8fe9d90e
|
@ -377,6 +377,8 @@ class AnalystData extends AppModel
|
|||
return $analystData;
|
||||
}
|
||||
$this->fetchedUUIDFromRecursion[$analystData['uuid']] = true;
|
||||
$this->Note = ClassRegistry::init('Note');
|
||||
$this->Opinion = ClassRegistry::init('Opinion');
|
||||
|
||||
$paramsNote = [
|
||||
'recursive' => -1,
|
||||
|
|
|
@ -31,6 +31,9 @@ class AnalystDataParentBehavior extends ModelBehavior
|
|||
$temp = $this->{$type}->fetchForUuid($object['uuid'], $this->__currentUser);
|
||||
if (!empty($temp)) {
|
||||
foreach ($temp as $k => $temp_element) {
|
||||
if (in_array($type, ['Note', 'Opinion', 'Relationship'])) {
|
||||
$temp_element[$type] = $this->{$type}->fetchChildNotesAndOpinions($this->__currentUser, $temp_element[$type], 1);
|
||||
}
|
||||
$data[$type][] = $temp_element[$type];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue