From 35fabbe7f6c3818572a4bc0ffecbbfd116a2f7da Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 17 Oct 2018 20:59:51 +0200 Subject: [PATCH] fix: [Galaxy] Various fixes to blocking issues with the galaxy update system, fixes #3773 --- app/Controller/GalaxiesController.php | 4 +++- app/Model/Galaxy.php | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Controller/GalaxiesController.php b/app/Controller/GalaxiesController.php index 86e0e5964..eea7fea04 100644 --- a/app/Controller/GalaxiesController.php +++ b/app/Controller/GalaxiesController.php @@ -34,7 +34,9 @@ class GalaxiesController extends AppController } if (!empty($this->params['named']['force'])) { $force = 1; - } + } else { + $force = 0; + } $result = $this->Galaxy->update($force); $message = 'Galaxies updated.'; if ($this->_isRest()) { diff --git a/app/Model/Galaxy.php b/app/Model/Galaxy.php index db00c4c89..b4dd282af 100644 --- a/app/Model/Galaxy.php +++ b/app/Model/Galaxy.php @@ -106,8 +106,7 @@ class Galaxy extends AppModel // Delete all existing outdated clusters foreach ($cluster_package['values'] as $k => $cluster) { if (empty($cluster['value'])) { - debug($cluster); - throw new Exception(); + continue; } if (isset($cluster['version'])) { } elseif (!empty($cluster_package['version'])) { @@ -130,6 +129,9 @@ class Galaxy extends AppModel // create all clusters foreach ($cluster_package['values'] as $cluster) { + if (empty($cluster['version'])) { + $cluster['version'] = 1; + } $template['version'] = $cluster['version']; $this->GalaxyCluster->create(); $cluster_to_save = $template;