mirror of https://github.com/MISP/MISP
fix: [event] Includes eventReport when using the `merge from` feature
parent
08e556e198
commit
c9e0326d4e
|
@ -2198,18 +2198,22 @@ class EventsController extends AppController
|
||||||
$results = [
|
$results = [
|
||||||
'results' => [
|
'results' => [
|
||||||
'Object' => $source_event[0]['Object'],
|
'Object' => $source_event[0]['Object'],
|
||||||
'Attribute' => $source_event[0]['Attribute']
|
'Attribute' => $source_event[0]['Attribute'],
|
||||||
|
'EventReport' => $source_event[0]['EventReport']
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
if ($this->_isRest()) {
|
if ($this->_isRest()) {
|
||||||
$this->loadModel('Log');
|
$this->loadModel('Log');
|
||||||
$save_results = ['attributes' => 0, 'objects' => 0];
|
$save_results = ['attributes' => 0, 'objects' => 0, 'eventReports' => 0];
|
||||||
foreach ($results['results']['Attribute'] as $attribute) {
|
foreach ($results['results']['Attribute'] as $attribute) {
|
||||||
$this->Event->Attribute->captureAttribute($attribute, $target_id, $this->Auth->user(), false, $this->Log);
|
$this->Event->Attribute->captureAttribute($attribute, $target_id, $this->Auth->user(), false, $this->Log);
|
||||||
}
|
}
|
||||||
foreach ($results['results']['Object'] as $object) {
|
foreach ($results['results']['Object'] as $object) {
|
||||||
$this->Event->Object->captureObject($object, $target_id, $this->Auth->user(), $this->Log);
|
$this->Event->Object->captureObject($object, $target_id, $this->Auth->user(), $this->Log);
|
||||||
}
|
}
|
||||||
|
foreach ($results['results']['EventReport'] as $report) {
|
||||||
|
$this->Event->EventReport->captureReport($this->Auth->user(), $report, $target_id);
|
||||||
|
}
|
||||||
$event = $this->Event->fetchEvent(
|
$event = $this->Event->fetchEvent(
|
||||||
$this->Auth->user(),
|
$this->Auth->user(),
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue