mirror of https://github.com/MISP/MISP
fix: [galaxy:editCluster] Correctly update galaxyElements
parent
ed74adf399
commit
eecd539b0a
|
@ -325,7 +325,7 @@ class GalaxyClustersController extends AppController
|
|||
if ($cluster['GalaxyCluster']['default']) {
|
||||
throw new MethodNotAllowedException('Default galaxy cluster cannot be edited');
|
||||
}
|
||||
$this->GalaxyCluster->data = array('GalaxyCluster' => $cluster['GalaxyCluster']);
|
||||
$this->GalaxyCluster->data = array('GalaxyCluster' => $cluster['GalaxyCluster'], 'GalaxyElement' => $cluster['GalaxyElement']);
|
||||
|
||||
$this->loadModel('Attribute');
|
||||
$distributionLevels = $this->Attribute->distributionLevels;
|
||||
|
@ -391,6 +391,7 @@ class GalaxyClustersController extends AppController
|
|||
}
|
||||
}
|
||||
} else {
|
||||
$this->GalaxyCluster->data['GalaxyCluster']['elements'] = json_encode($this->GalaxyCluster->data['GalaxyElement']);
|
||||
$this->GalaxyCluster->data['GalaxyCluster']['authors'] = json_encode($this->GalaxyCluster->data['GalaxyCluster']['authors']);
|
||||
$this->request->data = $this->GalaxyCluster->data;
|
||||
}
|
||||
|
|
|
@ -183,7 +183,11 @@ class GalaxyCluster extends AppModel
|
|||
$fieldList = array('value', 'description', 'version', 'source', 'authors', 'distribution', 'sharing_group_id', 'default');
|
||||
$saveSuccess = $this->save($cluster, array('fieldList' => $fieldList));
|
||||
if ($saveSuccess) {
|
||||
$this->GalaxyElement->updateElements($cluster['GalaxyCluster']['id'], $cluster['GalaxyCluster']['id'], $cluster['GalaxyCluster']['elements']);
|
||||
$elementsToSave = array();
|
||||
foreach ($cluster['GalaxyCluster']['elements'] as $element) { // transform cluster into Galaxy meta format
|
||||
$elementsToSave[$element['key']] = $element['value'];
|
||||
}
|
||||
$this->GalaxyElement->updateElements($cluster['GalaxyCluster']['id'], $cluster['GalaxyCluster']['id'], $elementsToSave);
|
||||
} else {
|
||||
foreach($this->validationErrors as $validationError) {
|
||||
$errors[] = $validationError[0];
|
||||
|
|
|
@ -2528,7 +2528,7 @@ table tr:hover .down-expand-button {
|
|||
position: absolute;
|
||||
right: 0px;
|
||||
top: 100px;
|
||||
max-width: 600px;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.widgetTitle {
|
||||
|
|
Loading…
Reference in New Issue