mirror of https://github.com/MISP/MISP
fix: [internal] Deleting events
parent
934fa326f9
commit
bbb21571bf
|
@ -2609,8 +2609,7 @@ class EventsController extends AppController
|
|||
foreach ($idList as $eid) {
|
||||
$event = $this->Event->find('first', array(
|
||||
'conditions' => Validation::uuid($eid) ? ['Event.uuid' => $eid] : ['Event.id' => $eid],
|
||||
'fields' => array('Event.orgc_id', 'Event.id', 'Event.user_id'),
|
||||
'recursive' => -1
|
||||
'recursive' => -1,
|
||||
));
|
||||
if (empty($event)) {
|
||||
$fails[] = $eid; // event not found
|
||||
|
|
|
@ -1351,9 +1351,9 @@ class Event extends AppModel
|
|||
return $data;
|
||||
}
|
||||
|
||||
public function quickDelete($event)
|
||||
public function quickDelete(array $event)
|
||||
{
|
||||
$id = $event['Event']['id'];
|
||||
$id = (int)$event['Event']['id'];
|
||||
$this->Thread = ClassRegistry::init('Thread');
|
||||
$thread = $this->Thread->find('first', array(
|
||||
'conditions' => array('Thread.event_id' => $id),
|
||||
|
@ -1440,7 +1440,8 @@ class Event extends AppModel
|
|||
foreach ($relations as $relation) {
|
||||
$queryTool->quickDelete($relation['table'], $relation['foreign_key'], $relation['value'], $this);
|
||||
}
|
||||
return $this->delete($id, false);
|
||||
$this->set($event);
|
||||
return $this->delete(null, false);
|
||||
}
|
||||
|
||||
public function createEventConditions($user)
|
||||
|
|
Loading…
Reference in New Issue