From 10fb800caabedd8b3bf07ce928c1a3b8b975c2f7 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:11:58 +0200 Subject: [PATCH] Fix the issue properly --- webapp/src/Controller/Jury/ExecutableController.php | 10 +++------- webapp/src/Service/ConfigurationService.php | 10 ---------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/webapp/src/Controller/Jury/ExecutableController.php b/webapp/src/Controller/Jury/ExecutableController.php index 881504df5e1..e3301f30f5a 100644 --- a/webapp/src/Controller/Jury/ExecutableController.php +++ b/webapp/src/Controller/Jury/ExecutableController.php @@ -12,6 +12,7 @@ use App\Service\EventLogService; use App\Utils\Utils; use Doctrine\ORM\EntityManagerInterface; +use InvalidArgumentException as PHPInvalidArgumentException; use Symfony\Component\HttpKernel\Attribute\MapQueryParameter; use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Form\Exception\InvalidArgumentException; @@ -68,15 +69,10 @@ public function indexAction(Request $request): Response $executables_table = []; $configScripts = []; foreach (['compare', 'run', 'full_debug'] as $config_script) { - /* Seems to fail try { $configScripts[] = (string)$this->config->get('default_' . $config_script); - } catch (InvalidArgumentException $e) { - // Ignore - }*/ - // If not found this is an older database, as we only use this for visual changes ignore this error; - if ($this->config->checkExistance('default_' . $config_script)) { - $configScripts[] = (string)$this->config->get('default_' . $config_script); + } catch (PHPInvalidArgumentException $e) { + // If not found this is an older database, as we only use this for visual changes ignore this error; } } diff --git a/webapp/src/Service/ConfigurationService.php b/webapp/src/Service/ConfigurationService.php index 687bc1b9bfa..eeeccf9d730 100644 --- a/webapp/src/Service/ConfigurationService.php +++ b/webapp/src/Service/ConfigurationService.php @@ -67,16 +67,6 @@ public function get(string $name, bool $onlyIfPublic = false) return $value; } - public function checkExistance(string $name): bool - { - try { - $this->get($name); - return true; - } catch (InvalidArgumentException $e) { - return false; - } - } - /** * Get all the configuration values, indexed by name. *