From c8f95182cbd46d2a8c0cf3fb4bf2ba95c9f97d25 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Tue, 10 Oct 2017 17:03:22 +1300 Subject: [PATCH] Fix icon urls --- code/Controllers/CMSMain.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/Controllers/CMSMain.php b/code/Controllers/CMSMain.php index 4178b7d2..6ff07e63 100644 --- a/code/Controllers/CMSMain.php +++ b/code/Controllers/CMSMain.php @@ -24,7 +24,7 @@ use SilverStripe\Control\HTTPResponse_Exception; use SilverStripe\Core\Convert; use SilverStripe\Core\Environment; use SilverStripe\Core\Injector\Injector; -use SilverStripe\Core\Manifest\ModuleLoader; +use SilverStripe\Core\Manifest\ModuleResourceLoader; use SilverStripe\Forms\DateField; use SilverStripe\Forms\DropdownField; use SilverStripe\Forms\FieldGroup; @@ -173,8 +173,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr Requirements::css('silverstripe/cms: client/dist/styles/bundle.css'); Requirements::customCSS($this->generatePageIconsCss(), self::PAGE_ICONS_ID); - $module = ModuleLoader::getModule('silverstripe/cms'); - Requirements::add_i18n_javascript($module->getRelativeResourcePath('client/lang'), false, true); + Requirements::add_i18n_javascript('silverstripe/cms: client/lang', false, true); CMSBatchActionHandler::register('restore', CMSBatchAction_Restore::class); CMSBatchActionHandler::register('archive', CMSBatchAction_Archive::class); @@ -1069,7 +1068,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr 'AddAction' => $singularName, 'Description' => $description, // TODO Sprite support - 'IconURL' => $instance->config()->get('icon'), + 'IconURL' => ModuleResourceLoader::resourceURL($instance->config()->get('icon')), 'Title' => $singularName, ))); }