From d3029f8e69ec97b436579e7761ba43668e969db7 Mon Sep 17 00:00:00 2001 From: Philippe Ducharme Date: Wed, 26 Nov 2025 17:03:21 -0500 Subject: [PATCH] Allow dashboards with dashes in code to be accessed --- modules/backend/classes/BackendController.php | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/modules/backend/classes/BackendController.php b/modules/backend/classes/BackendController.php index 2071ee8e23..1c8ba0f677 100644 --- a/modules/backend/classes/BackendController.php +++ b/modules/backend/classes/BackendController.php @@ -82,15 +82,24 @@ public function run($url = null) $controller = $params[1] ?? 'index'; $isApp = strtolower($module) === 'app'; - self::$action = $action = isset($params[2]) ? $this->parseAction($params[2]) : 'index'; - self::$params = $controllerParams = array_slice($params, 3); $controllerClass = "{$module}\\Controllers\\{$controller}"; $controllerBase = $isApp ? base_path() : base_path('modules'); - if ($controllerObj = $this->findController( - $controllerClass, - $action, - $controllerBase - )) { + + // Try finding the controller first with the original action + $originalAction = $params[2] ?? 'index'; + $controllerObj = $this->findController($controllerClass, $originalAction, $controllerBase); + + // Use the original action for WildcardController, otherwise transform the action + $action = $originalAction; + if (!($controllerObj instanceof WildcardController)) { + $action = $this->parseAction($originalAction); + $controllerObj = $this->findController($controllerClass, $action, $controllerBase); + } + + self::$action = $action; + self::$params = $controllerParams = array_slice($params, 3); + + if ($controllerObj) { if (!$isApp && !System::hasModule(ucfirst($module))) { return Response::make(View::make('backend::404'), 404); }