mirror of https://github.com/MISP/MISP
fix: [api] Sharing group organisations not iterated if they don't exist
parent
92eb8a91ad
commit
543fccdc58
|
@ -187,6 +187,7 @@ class SharingGroup extends AppModel
|
|||
));
|
||||
}
|
||||
$sg['Organisation'] = $this->__sgoCache[$sg['SharingGroup']['org_id']];
|
||||
if (!empty($sg['SharingGroupOrg'])) {
|
||||
foreach ($sg['SharingGroupOrg'] as &$sgo) {
|
||||
if (!isset($this->__sgoCache[$sgo['org_id']])) {
|
||||
$this->__sgoCache[$sgo['org_id']] = $this->Organisation->find('first', array(
|
||||
|
@ -198,6 +199,7 @@ class SharingGroup extends AppModel
|
|||
$sgo['Organisation'] = $this->__sgoCache[$sgo['org_id']];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $sgs;
|
||||
} elseif ($scope == 'name') {
|
||||
$sgs = $this->find('list', array(
|
||||
|
|
Loading…
Reference in New Issue