Problem/Motivation
CSS aggregation isn't automatically disabled in ^10.1 in maintenance mode and doesn't aggregate CSS for users without the 'access site in maintenance mode'
permission, resulting in unstyled pages.
Steps to reproduce
- Install Drupal core ^10.1
- Make sure no aggregated CSS for the maintenance page is saved to disk. Delete the aggregated asset directory if necessary.
- Enable CSS aggregation and turn on maintenance mode.
- Visit the site with a user that does not have the
'access site in maintenance mode'
permission. You should end up with an unstyled page. - Check the browser console; in both Firefox and Chrome, you should see some variation of an error that the aggregated CSS was not loaded due to corrupt or incorrect content type, as it's actually serving the maintenance page HTML rather than CSS.
Proposed resolution
At Neurocracy/Omnipedia we settled on adding '_maintenance_access': true
option to the 'system.css_asset'
route as a workaround to allow us to use aggregated CSS, but a better solution may be to disable CSS aggregation automatically like JS aggregation seems to be in maintenance mode.
Remaining tasks
TBD.
User interface changes
CSS actually loads.
API changes
None?
Data model changes
None?
Release notes snippet
TBD.