mirror of https://github.com/MISP/MISP
fix: Mass edit and AttackMatrix work again on objectAttributes
parent
b4c6b31b8a
commit
a291669c2e
|
@ -4639,7 +4639,8 @@ class EventsController extends AppController
|
|||
} elseif ($scope == 'attribute') {
|
||||
$attribute = $this->Event->Attribute->fetchAttributes($this->Auth->user(), array(
|
||||
'conditions' => array('Attribute.id' => $scope_id),
|
||||
'fields' => array('event_id')
|
||||
'fields' => array('event_id'),
|
||||
'flatten' => 1,
|
||||
));
|
||||
if (empty($attribute)) {
|
||||
throw new Exception("Invalid Attribute.");
|
||||
|
|
|
@ -132,7 +132,10 @@ class AttributeTag extends AppModel
|
|||
}
|
||||
|
||||
$allTags = array();
|
||||
$attributes = $this->Attribute->fetchAttributes($user, array('conditions' => array('Attribute.id' => $attributeIds, 'Attribute.event_id' => $requestedEventId)));
|
||||
$attributes = $this->Attribute->fetchAttributes($user, array(
|
||||
'conditions' => array('Attribute.id' => $attributeIds, 'Attribute.event_id' => $requestedEventId),
|
||||
'flatten' => 1,
|
||||
));
|
||||
foreach ($attributes as $attribute) {
|
||||
$attributeTags = $this->find('all', array(
|
||||
'conditions' => array(
|
||||
|
@ -162,14 +165,13 @@ class AttributeTag extends AppModel
|
|||
|
||||
$allClusters = array();
|
||||
foreach ($attributeIds as $id) {
|
||||
$attribute = $this->Attribute->fetchAttributes($user, array('conditions' => array('Attribute.id' => $id)));
|
||||
$attribute = $this->Attribute->fetchAttributes($user, array(
|
||||
'conditions' => array('Attribute.id' => $id, 'Attribute.event_id' => $requestedEventId),
|
||||
'flatten' => 1,
|
||||
));
|
||||
if (empty($attribute)) {
|
||||
throw new MethodNotAllowedException('Invalid attribute.');
|
||||
}
|
||||
$eventId = $attribute[0]['Attribute']['event_id'];
|
||||
if ($eventId != $requestedEventId) { // only takes tags of attributes belonging to the same event
|
||||
continue;
|
||||
}
|
||||
$attributeTags = $this->find('all', array(
|
||||
'conditions' => array(
|
||||
'attribute_id' => $id
|
||||
|
|
Loading…
Reference in New Issue