From 0c418967fe3044bb65914184acbe632597ee8978 Mon Sep 17 00:00:00 2001 From: Marcel Folaron Date: Fri, 23 Aug 2024 23:50:09 -0400 Subject: [PATCH] fixing menu related bugs --- app/Core/Controller/Controller.php | 2 +- app/Domain/Menu/Composers/Menu.php | 3 +++ app/Domain/Menu/Hxcontrollers/ProjectSelector.php | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Core/Controller/Controller.php b/app/Core/Controller/Controller.php index 240188a70..f31e32cb4 100644 --- a/app/Core/Controller/Controller.php +++ b/app/Core/Controller/Controller.php @@ -96,7 +96,7 @@ private function executeActions(string $method, object|array $params): void $this->response = $this->run(); } else { Log::error('Method not found: ' . $method); - throw new HttpResponseException(Frontcontroller::redirect(BASE_URL . "/errors/error501", 307)); + Frontcontroller::redirect(BASE_URL . "/errors/error501", 307); } } diff --git a/app/Domain/Menu/Composers/Menu.php b/app/Domain/Menu/Composers/Menu.php index 721191e03..87221a1f9 100644 --- a/app/Domain/Menu/Composers/Menu.php +++ b/app/Domain/Menu/Composers/Menu.php @@ -106,6 +106,8 @@ public function with(): array ]; } + $newProjectUrl = self::dispatch_filter("startSomething", "#/projects/createnew"); + return [ 'currentClient' => $currentClient, 'module' => FrontcontrollerCore::getModuleName(), @@ -126,6 +128,7 @@ public function with(): array 'projectSelectGroupOptions' => $projectSelectGroupOptions, 'projectSelectFilter' => $projectSelectFilter, 'clients' => $clients, + 'startSomethingUrl' => $newProjectUrl ]; } } diff --git a/app/Domain/Menu/Hxcontrollers/ProjectSelector.php b/app/Domain/Menu/Hxcontrollers/ProjectSelector.php index bac7d5878..100379abe 100644 --- a/app/Domain/Menu/Hxcontrollers/ProjectSelector.php +++ b/app/Domain/Menu/Hxcontrollers/ProjectSelector.php @@ -112,6 +112,7 @@ public function updateMenu(): void ]; } + $newProjectUrl = self::dispatch_filter("startSomething", "#/projects/createnew"); $this->tpl->assign('currentClient', $currentClient); $this->tpl->assign('module', FrontcontrollerCore::getModuleName()); @@ -132,6 +133,8 @@ public function updateMenu(): void $this->tpl->assign('projectSelectGroupOptions', $projectSelectGroupOptions); $this->tpl->assign('projectSelectFilter', $projectSelectFilter); $this->tpl->assign('clients', $clients); + $this->tpl->assign('startSomethingUrl', $newProjectUrl); + } /**