Merge branch '2.4' of github.com:MISP/MISP into 2.4

pull/4861/head
chrisr3d 2019-07-09 17:04:59 +02:00
commit 5089e9974d
3 changed files with 9 additions and 4 deletions

View File

@ -298,13 +298,13 @@ class GalaxiesController extends AppController
$target_id_list = array($target_id);
}
$cluster_ids = $this->request->data['Galaxy']['target_ids'];
if (!empty($cluster_ids)) {
if (strlen($cluster_ids) > 0) {
$cluster_ids = json_decode($cluster_ids, true);
if ($cluster_ids === null) {
return new CakeResponse(array('body'=> json_encode(array('saved' => false, 'error' => __('Failed to parse request.'))), 'status'=>200, 'type' => 'json'));
if ($cluster_ids === null || empty($cluster_ids)) {
return new CakeResponse(array('body'=> json_encode(array('saved' => false, 'errors' => __('Failed to parse request or no clusters picked.'))), 'status'=>200, 'type' => 'json'));
}
} else {
return new CakeResponse(array('body'=> json_encode(array('saved' => false, 'error' => __('No clusters picked.'))), 'status'=>200, 'type' => 'json'));
return new CakeResponse(array('body'=> json_encode(array('saved' => false, 'errors' => __('Failed to parse request.'))), 'status'=>200, 'type' => 'json'));
}
$result = "";
if (!is_array($cluster_ids)) { // in case we only want to attach 1

View File

@ -183,6 +183,10 @@ function submitFunction(clicked, callback) {
} else {
selected = $select.val();
}
if (selected === null) {
showMessage('fail', '<?php echo __('No item picked'); ?>');
return;
}
var additionalData = $select.data('additionaldata');
if (additionalData !== undefined) {

View File

@ -3746,6 +3746,7 @@ function addGalaxyListener(id) {
}
function quickSubmitGalaxyForm(cluster_ids, additionalData) {
cluster_ids = cluster_ids === null ? [] : cluster_ids;
var target_id = additionalData['target_id'];
var scope = additionalData['target_type'];
var local = additionalData['local'];