-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Issue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for development
Description
It seems that added / installed themes are not registered if they are added to a site which is already installed and is set to production mode. By registered I mean that they are not added to the theme table.
After looking at the code it seems that themes are registered differently depending on mode.
In developer mode:
- Registered at https://github.com/magento/magento2/blob/develop/app/code/Magento/Theme/Model/Theme/Plugin/Registration.php#L74 which means that the installed theme will be registered correctly during development (or all modes except production).
In production mode:
- Registered in observer, https://github.com/magento/magento2/blob/develop/app/code/Magento/Theme/Observer/ThemeRegistrationObserver.php#L47. The event is fired in the installation script of magento/module-theme, https://github.com/magento/magento2/blob/develop/app/code/Magento/Theme/Setup/InstallData.php#L54 which means that it will only register themes during the initial installation of the site and not during upgrades.
This means that if you have a running site in production mode and you decide to install a new theme it will not be registered in the theme table which means that it will not be selectable in the admin.
Steps to reproduce:
- Install Magento2, run the installation wizard
- Set deploy mode to production, php bin/magento deploy:mode:set production
- Add a theme with: composer require
- Run php bin/magento setup:upgrade
Expected result:
The installed theme should be registered in the theme table.
Actual result:
The installed theme is not registered in the theme table.
Metadata
Metadata
Assignees
Labels
Issue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for development