From 06dab6b53946d96105d055f4c5b53364954476f0 Mon Sep 17 00:00:00 2001 From: mattclegg Date: Mon, 16 Mar 2020 18:54:01 +0545 Subject: [PATCH] [BUGFIX] silverstripe/admin is not required to be installed If the silverstripe/admin module is not installed then the javascript/css requirements fail to load --- src/Security/CMSSecurity.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Security/CMSSecurity.php b/src/Security/CMSSecurity.php index ddacc50de..9bba8e4d1 100644 --- a/src/Security/CMSSecurity.php +++ b/src/Security/CMSSecurity.php @@ -39,9 +39,11 @@ class CMSSecurity extends Security // Assign default cms theme and replace user-specified themes SSViewer::set_themes(LeftAndMain::config()->uninherited('admin_themes')); - // Core styles / vendor scripts - Requirements::javascript('silverstripe/admin: client/dist/js/vendor.js'); - Requirements::css('silverstripe/admin: client/dist/styles/bundle.css'); + if (ModuleLoader::getModule('silverstripe/admin')) { + // Core styles / vendor scripts + Requirements::javascript('silverstripe/admin: client/dist/js/vendor.js'); + Requirements::css('silverstripe/admin: client/dist/styles/bundle.css'); + } } public function login($request = null, $service = Authenticator::CMS_LOGIN)