Problem/Motivation
During the installation process, if the default theme contain block config, this config is applied to the admin theme.
I've created a basic install profile to demonstrate the issue.
Steps to reproduce :
- download the attached install profile in your /profiles directory
- install drupal using the admthemebug profile
- log in
- go to admin/structure/block/list/seven
Expected result: the "Powered by Drupal" block is not enabled
Current result: the "Powered by Drupal" block is in the "Header" region
Known workaround
Use bartik as default theme then, in an install task, install your own theme, set it as default and uninstall bartik.
Proposed resolution
None yet.
Remaining tasks
Find a solution, fix it, commit, enjoy
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #2
duaelfrThis is still an issue in 8.0.6 (just faced it on a new project)
Comment #3
dcrocks commented#2632132: Move Claro standard profile block config into the Claro theme addresses this. By using config/optional to contain seven's blocks yml files, seven will always have the correct block/region configuration no matter when or how many times seven is installed.
See also Optional configuration provided by modules and themes is now stored in config/optional
ps. I am seeking reviews for this and related patches, if they are to ever get in.
Comment #4
duaelfr@dcrocks Thank you for your workaround.
It's still a bug, though. In my case, I have no "unmet dependencies" issue, the blocks are just enabled for the wrong theme.
Plus, as it's not forbidden to put config files in ou theme's config/install, it should work properly.
Comment #5
dcrocks commentedAs I understand your issue summary, this is about seven receiving unexpected blocks when it is installed. It is not about your theme. If you do a standard drupal install, uninstall seven, then re-install it, you will see the exact same behavior as you are seeing. #2632132: Move Claro standard profile block config into the Claro theme fixes that.
As to why config/optional than config/install, to quote the change notice referenced in #3
That becomes clear when running drupal tests, as often seven is used when some necessary modules are unavailable.
Try the patch on your install and see what happens. But otherwise, since this is about seven, it is a duplicate.
Comment #6
duaelfrI used seven as a demonstration. The same issue also happens if the admin theme is classy, which does not have any block config.
This issue only happens during site install and, as you cannot uninstall your admin theme, it cannot be reproduced the way you're telling me.
Please, take a moment to test with this new profile :
Steps to reproduce :
Expected result: the "Powered by Drupal" block is not enabled
Current result: the "Powered by Drupal" block is in the "Header" region
Comment #7
dcrocks commentedBut you can make some other theme(e.g. bartik) the admin theme, then uninstall and install seven. I've done it and the symptom is the same as you are seeing.
Comment #9
joginderpcI had verified with all themes seven, bartik, stark and classy the given issue is not replicating after applying patch.
Expected result: the "Powered by Drupal" block is not enabled
Current result: the "Powered by Drupal" block is in the "Header" region (Not replicated.)
Comment #10
duaelfrNo patch has been attached to this issue so it should not be marked as RTBC.
The thing is that moving the config files to the config/optional folder of the themes is just a workaround. The real issue, that makes Core add blocks to the wrong theme under certain circumstances, still exists.
Comment #12
sk33lz commentedI applied the patch from #2632132, but was still getting the blocks placed in the header in Seven theme when doing some final testing on our Bear installation profile for an upcoming D8 release. After applying that patch I added an install config file for the branding block for Seven theme, as that seemed most out of place and it somehow fixed all the other blocks from being placed in the header region as well. This seems like an overall bug in the config system, but at least the attached patch fixes the Seven block placements out of the box when installing a custom Installation profile.
Note: The patch from #2632132 is not required to be applied to fix this particular issue with the header block placements in the Seven theme, although it is probably a better approach to saving the config file for core themes in general and should probably be applied as well.
Comment #18
frobThis also happens when attempting to change the admin theme after site building.
I built a site and needed to update some of the css in our admin theme (material_admin in this case) so I created a sub-theme of material and changed our sites admin theme. It looks to be pulling the default configuration from somewhere. It made the site unusable. I would have expected it to take the config from material_admin and apply it to the sub-theme.
Comment #26
zaporylieThis still happens even if the theme is enabled via Recipe. Applying
drupal/drupal_cms_admin_uirecipe on the existing site with customized block placement makes these blocks also appear in the Gin admin theme.