[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
This commit is contained in:
mattclegg 2020-03-16 18:54:01 +05:45
parent 5fd16cd7e1
commit 06dab6b539
No known key found for this signature in database
GPG Key ID: 38F89AD4DDF94EC3
1 changed files with 5 additions and 3 deletions

View File

@ -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)