From a2fd75a2aebad77ffc04983ca171ac8c054c8fe5 Mon Sep 17 00:00:00 2001 From: Makreig Date: Mon, 16 Mar 2020 10:21:31 +0000 Subject: [PATCH 1/2] fixed chart requirements calls --- src/DashboardChart.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DashboardChart.php b/src/DashboardChart.php index 8b96312..2d8e878 100644 --- a/src/DashboardChart.php +++ b/src/DashboardChart.php @@ -171,9 +171,9 @@ public function setData($data) { * @return \SilverStripe\ORM\FieldType\DBHTMLText */ public function forTemplate() { - Requirements::javascript("dashboard/javascript/thirdparty/google_jsapi_visualization.js"); - Requirements::javascript("dashboard/javascript/dashboard-chart.js"); - return $this->renderWith('DashboardChart'); + Requirements::javascript("unclecheese/dashboard:javascript/thirdparty/google_jsapi_visualization.js"); + Requirements::javascript("unclecheese/dashboard:javascript/dashboard-chart.js"); + return $this->renderWith(self::class); } From 4acb5c996bafc59133df319314ed919b95cb0dba Mon Sep 17 00:00:00 2001 From: Makreig Date: Mon, 16 Mar 2020 11:09:52 +0000 Subject: [PATCH 2/2] fixed DashboardPanelAction->Action method --- src/DashboardPanelAction.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/DashboardPanelAction.php b/src/DashboardPanelAction.php index 832dac7..f3e2bec 100644 --- a/src/DashboardPanelAction.php +++ b/src/DashboardPanelAction.php @@ -3,6 +3,7 @@ namespace UncleCheese\Dashboard; use SilverStripe\View\ViewableData; +use SilverStripe\ORM\FieldType\DBHTMLText; /** * Defines the object that renders as a button in a dashboard panel @@ -81,7 +82,7 @@ public function forTemplate() { * @return string */ public function Action() { - return $this->forTemplate(); + return DBHTMLText::create()->setValue($this->forTemplate()); }