mirror of https://github.com/MISP/MISP
fix: Fixed some galaxy cluster inconsistencies
parent
bfcb85f56f
commit
3c6e2e0335
|
@ -48,8 +48,7 @@ class GalaxiesController extends AppController {
|
|||
if (empty($galaxy)) {
|
||||
throw new NotFoundException('Galaxy not found.');
|
||||
}
|
||||
$this->set('Galaxy', $galaxy);
|
||||
$this->set('_serialize', array('Galaxy'));
|
||||
return $this->RestResponse->viewData($galaxy, $this->response->type());
|
||||
} else {
|
||||
$galaxy = $this->Galaxy->find('first', array(
|
||||
'recursive' => -1,
|
||||
|
|
|
@ -38,6 +38,15 @@ class GalaxyCluster extends AppModel{
|
|||
return true;
|
||||
}
|
||||
|
||||
public function afterFind($results, $primary = false) {
|
||||
foreach ($results as $k => $result) {
|
||||
if (isset($results[$k]['GalaxyCluster']['authors'])) {
|
||||
$results[$k]['GalaxyCluster']['authors'] = json_decode($results[$k]['GalaxyCluster']['authors'], true);
|
||||
}
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function beforeDelete($cascade = true) {
|
||||
$this->GalaxyElement->deleteAll(array('GalaxyElement.galaxy_cluster_id' => $this->id));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue