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 :

  1. download the attached install profile in your /profiles directory
  2. install drupal using the admthemebug profile
  3. log in
  4. 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

DuaelFr created an issue. See original summary.

duaelfr’s picture

This is still an issue in 8.0.6 (just faced it on a new project)

dcrocks’s picture

#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.

duaelfr’s picture

@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.

dcrocks’s picture

As 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

Themes can not directly depend on modules so all configuration entities created by themes should go in config/optional.

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.

duaelfr’s picture

StatusFileSize
new912 bytes

I 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 :

  1. download the attached install profile in your /profiles directory
  2. install drupal using the admthemebug_classy profile
  3. log in
  4. go to admin/structure/block/list/classy

Expected result: the "Powered by Drupal" block is not enabled
Current result: the "Powered by Drupal" block is in the "Header" region

dcrocks’s picture

But 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.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

joginderpc’s picture

Status: Active » Reviewed & tested by the community
Issue tags: +bug not replicated

I 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.)

duaelfr’s picture

Status: Reviewed & tested by the community » Active
Issue tags: -bug not replicated

No 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.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

sk33lz’s picture

Status: Active » Needs review
StatusFileSize
new685 bytes

I 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.

Status: Needs review » Needs work

The last submitted patch, 12: drupal-2665384-12.patch, failed testing.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

frob’s picture

This 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.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

zaporylie’s picture

This still happens even if the theme is enabled via Recipe. Applying drupal/drupal_cms_admin_ui recipe on the existing site with customized block placement makes these blocks also appear in the Gin admin theme.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.