diff --git a/src/Forms/WidgetAreaEditor.php b/src/Forms/WidgetAreaEditor.php index eb479f6..18d3441 100644 --- a/src/Forms/WidgetAreaEditor.php +++ b/src/Forms/WidgetAreaEditor.php @@ -40,8 +40,9 @@ class WidgetAreaEditor extends FormField */ public function FieldHolder($properties = array()) { - Requirements::css('widgets/css/WidgetAreaEditor.css'); - Requirements::javascript('widgets/javascript/WidgetAreaEditor.js'); + $module = ModuleLoader::getModule('silverstripe/widgets'); + Requirements::css($module->getRelativeResourcePath('css/WidgetAreaEditor.css')); + Requirements::javascript($module->getRelativeResourcePath('javascript/WidgetAreaEditor.js')); return $this->renderWith(WidgetAreaEditor::class); } diff --git a/src/Model/Widget.php b/src/Model/Widget.php index f86d6bd..210f552 100644 --- a/src/Model/Widget.php +++ b/src/Model/Widget.php @@ -250,7 +250,7 @@ class Widget extends DataObject } /** - * @throws Exception + * @throws Exception If the widget controller's class name couldn't be found * * @return WidgetController */ @@ -268,7 +268,7 @@ class Widget extends DataObject } if (!class_exists($controllerClass)) { - throw new Exception("Could not find controller class for get_class($this)name"); + throw new Exception('Could not find controller class for ' . $controllerClass); } $this->controller = Injector::inst()->create($controllerClass, $this);