fix: [attackMatrix] only return the result for the last attached galaxy

If a galaxy is already attached, just skip the message.
(The return value is a string, we don't want to compare the string value for
each galaxy to be attached)
pull/3372/head
Sami Mokaddem 2018-06-22 12:16:12 +00:00
parent 3409e66b96
commit 05a56a3048
1 changed files with 2 additions and 2 deletions

View File

@ -158,9 +158,9 @@ class GalaxiesController extends AppController {
public function attachMultipleClusters($target_id, $target_type = 'event') {
$cluster_ids = json_decode($this->request->data['Galaxy']['target_ids'], true);
$result = ""; // temp
$result = "";
foreach($cluster_ids as $cluster_id) {
$result .= $this->Galaxy->attachCluster($this->Auth->user(), $target_type, $target_id, $cluster_id);
$result = $this->Galaxy->attachCluster($this->Auth->user(), $target_type, $target_id, $cluster_id);
}
$this->Flash->info($result);
$this->redirect($this->referer());