mirror of https://github.com/MISP/MISP
Deleting attributes deletes associated shadow attributes
There was a bug causing "zombie" shadowattributes to stay in events if the attribute has been deletedpull/195/head
parent
9f3dadfadf
commit
807cc4c090
|
@ -778,7 +778,10 @@ class AttributesController extends AppController {
|
|||
// find the uuid
|
||||
$this->__deleteAttributeFromServers($uuid);
|
||||
}
|
||||
|
||||
|
||||
// We have just deleted the attribute, let's also check if there are any shadow attributes that were attached to it and delete them
|
||||
$this->loadModel('ShadowAttribute');
|
||||
$this->ShadowAttribute->deleteAll(array('ShadowAttribute.old_id' => $id), false);
|
||||
$this->Session->setFlash(__('Attribute deleted'));
|
||||
} else {
|
||||
$this->Session->setFlash(__('Attribute was not deleted'));
|
||||
|
|
Loading…
Reference in New Issue