You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
silverstripe/admin 1.1.1 SilverStripe admin interface
silverstripe/asset-admin 1.1.1 Asset management for the SilverStripe CMS
silverstripe/assets 1.1.1 SilverStripe Assets component
silverstripe/campaign-admin 1.1.1 SilverStripe campaign admin interface
silverstripe/cms 4.1.1 The SilverStripe Content Management System
silverstripe/config 1.0.4 SilverStripe configuration based on YAML and class statics
silverstripe/errorpage 1.1.1 ErrorPage component for SilverStripe CMS
silverstripe/framework 4.1.1 The SilverStripe framework
silverstripe/graphql 1.1.1 GraphQL server for SilverStripe models and other data
silverstripe/reports 4.1.1 Reports module for SilverStripe CMS
silverstripe/siteconfig 4.1.1 Site wide settings administration.
silverstripe/versioned 1.1.1 SilverStripe Versioned component
Description
I noticed after creating a new 4.1 project with the public/ sub-folder that a good number of my page icons have broken in the CMS. All of the objects in question have their $icon defined in module format, i.e.:
...and each module has the admin/client/dist/ folder exposed via composer.json.
Upon investigating the CMS code, it appears the issue lies with when the generatePageIconsCss() method is called from the LeftAndMainPageIconsExtension class. I noticed this method appears to be called twice, once in CMSMain::init() and again in the extension itself, i.e. LeftAndMainPageIconsExtension::init(). Since CMSMain::PAGE_ICONS_ID is used as an identifier, the actual CSS is only generated once by CMSMain.
Now what's weird is, when it's called in CMSMain::init(), it does NOT generate the style classes for my modules. If I comment out that line, and rely on LeftAndMainPageIconsExtension::init(), it DOES generate the correct CSS.
Digging deeper, the generatePageIconsCss() method calls getPageIconURL() on all SiteTree classes. In SiteTree::getPageIconURL(), we can see the resource loader try to find the icon:
Now, when CMSMain::init() triggers this code, $iconResource is a string. When LeftAndMainPageIconsExtension::init() triggers it, $iconResource is a ModuleResource. I have no idea why that is happening, but I believe that's why it's breaking.
It probably wasn't noticed before using the separate public/ folder, because the string path still would have resolved in the docroot.
The text was updated successfully, but these errors were encountered:
Affected Version
Description
I noticed after creating a new 4.1 project with the
public/
sub-folder that a good number of my page icons have broken in the CMS. All of the objects in question have their$icon
defined in module format, i.e.:...and each module has the
admin/client/dist/
folder exposed viacomposer.json
.Upon investigating the CMS code, it appears the issue lies with when the
generatePageIconsCss()
method is called from theLeftAndMainPageIconsExtension
class. I noticed this method appears to be called twice, once inCMSMain::init()
and again in the extension itself, i.e.LeftAndMainPageIconsExtension::init()
. SinceCMSMain::PAGE_ICONS_ID
is used as an identifier, the actual CSS is only generated once byCMSMain
.Now what's weird is, when it's called in
CMSMain::init()
, it does NOT generate the style classes for my modules. If I comment out that line, and rely onLeftAndMainPageIconsExtension::init()
, it DOES generate the correct CSS.Digging deeper, the
generatePageIconsCss()
method callsgetPageIconURL()
on allSiteTree
classes. InSiteTree::getPageIconURL()
, we can see the resource loader try to find the icon:Now, when
CMSMain::init()
triggers this code,$iconResource
is astring
. WhenLeftAndMainPageIconsExtension::init()
triggers it,$iconResource
is aModuleResource
. I have no idea why that is happening, but I believe that's why it's breaking.It probably wasn't noticed before using the separate
public/
folder, because the string path still would have resolved in the docroot.The text was updated successfully, but these errors were encountered: