From bb502a85e877f8427235af25bbc83c87b215352b Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 18 Mar 2022 19:54:12 +0100 Subject: [PATCH] fix para and dashboard bug --- Admin/Installer.php | 2 +- Controller/BackendController.php | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Admin/Installer.php b/Admin/Installer.php index df8231a..7b595d6 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -101,7 +101,7 @@ final class Installer extends InstallerAbstract ]; foreach ($dashboardData as $dashboard) { - switch ($dashboard['component']) { + switch ($dashboard['type']) { case 'component': $result['component'][] = self::createComponent($app->dbPool, $dashboard); break; diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 39461c4..961cb6b 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -51,7 +51,10 @@ final class BackendController extends Controller $view->setTemplate('/Modules/Dashboard/Theme/Backend/dashboard'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000301001, $request, $response)); - $board = DashboardBoardMapper::get()->where('account', $request->header->account)->execute(); + $board = DashboardBoardMapper::get() + ->with('components') + ->where('account', $request->header->account) + ->execute(); if ($board instanceof NullDashboardBoard) { $board = DashboardBoardMapper::get()->where('id', 1)->execute(); @@ -61,11 +64,11 @@ final class BackendController extends Controller $boardComponents = $board->getComponents(); foreach ($boardComponents as $component) { - if (!$this->app->moduleManager->isActive($component->getModule())) { + if (!$this->app->moduleManager->isActive($component->module)) { continue; } - $module = $this->app->moduleManager->get($component->getModule()); + $module = $this->app->moduleManager->get($component->module); if ($module instanceof DashboardElementInterface) { $panels[] = $module->viewDashboard($request, $response, $data); }