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