Uninstall and then re-install Seven and you will get four undated blocks in the content header region, see screenshot. This shouldn't happen.

Issue fork drupal-2632132

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Jeff Burnz created an issue. See original summary.

Jeff Burnz’s picture

Title: Reinstalling Seven results in 4 blocks in the content header » Reinstalling Seven or Bartik results in blocks gone to hell

I see whats going on now, the block instal configuration is in the profile, not in the theme, this is mistake - the block configuration should be in the theme - especially for Seven theme.

lewisnyman’s picture

Title: Reinstalling Seven or Bartik results in blocks gone to hell » Move Seven block config into the Seven theme
Category: Bug report » Task

This makes a lot of sense, I've already seen a lot of problems with custom install profiles and blocks being placed in the wrong regions. If they were set in the theme then developers wouldn't have to do this themselves.

I don't know what makes sense for Bartik, does it make sense to split the issues? The use case for Seven is really strong.

dcrocks’s picture

I tested moving seven's config install files to the theme's directory from the standard profile's directory and drupal install finished without error. Nor was there weirdness after uninstalling then installing seven again. Haven't looked at impact against tests yet.
If config install files should be local for themes shouldn't they be local for modules as well?

Jeff Burnz’s picture

Can the config system be changed to look in the theme/module first then in the selected/active profile?

dcrocks’s picture

I ran an experiment to confirm what I thought I saw in the code. A configuration file in profiles/standard/config/install overrides one with the same name in core/themes/themename/config/install, even after the theme is uninstalled and then re-installed. This makes sense when installing drupal, but I don't think it is appropriate behavior after install.

dcrocks’s picture

Still trying to figure out behavior.
1) So, during drupal install all the profile/config/install files for themes and modules are installed.
2) After drupal install if a theme's or module's config/install directory does not exist or is empty then profile/config/install files are ignored when re-installing the theme or module.
3) If a theme or module has a non-empty config/install directory then all those files will be processed, but if any file has matching entry('s) in profile/config/install, they will be overridden by the corresponding files in the profile/config/install files.

This really only applies to themes and modules installed during drupal install, so maybe the behavior (3) isn't so worrisome. So the simple answer is to move those install files to the object that is being installed.

dcrocks’s picture

Status: Active » Needs review
StatusFileSize
new2.96 KB

Simple move

Status: Needs review » Needs work

The last submitted patch, 8: Move_Seven_block_config_into_the_Seven_theme-8.patch, failed testing.

dcrocks’s picture

I don't quite know what this failure is saying. Clearly install has no problem. Is it saying this config info HAS to be in the install profile? Is this test checking to see if the config files exist in install directories before the install is attempted?

swentel’s picture

All the failures are due to unmet dependencies. You should move those block files to the 'optional' directory, so into themes/seven/config/optional and not install, because some blocks might have dependencies on modules and/or other configuration.

dcrocks’s picture

How do I determine the unmet dependency? Using config/optional works but seems misleading as these configuration files certainly are required for the theme to work properly. Is this just to get around some tests?

swentel’s picture

Moving them all to optional shouldn't be a problem, Drupal will always scan this folder when a new extension is installed.
So say that on initial install only 4 files are imported, when enabling a new module it will scan the folder again to figure out if there's something that can be newly imported or not.

And yes, this is to get around failing tests where not every module is enabled always, like say the help module.

dcrocks’s picture

Status: Needs work » Needs review
StatusFileSize
new2.98 KB

This moves everything to optional.

Jeff Burnz’s picture

@swentel wow, thanks for the heads up on optional, I had no idea this even was a thing!

dcrocks’s picture

The documentation for this is in the change records. Given that 8.0 is out, this is harder to find than it should be.
Optional configuration provided by modules and themes is now stored in config/optional

dcrocks’s picture

Added issues for stark and bartik. Raises the question as to whether config files for modules should also be stored with the module.

dcrocks’s picture

There weren't any test system failures for this change to Seven but it still seems misleading to me to have these files in an 'optional' folder. It might be better to leave the files in the profile/config/install directories and move a copy into the theme's config/install directory. Not pretty but would work. Any thoughts?

dcrocks’s picture

Would like to note this is a problem for modules as well. If you uninstall and then reinstall a module you will lose any configuration files installed by the install profile's config/install folder. RDF and Responsive Images are simple examples.

dcrocks’s picture

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

For consistency

dcrocks’s picture

How do you force retest on these?

Status: Needs review » Needs work
dcrocks’s picture

Status: Needs work » Needs review
StatusFileSize
new2.98 KB

Try again. 'git clone' is more complicated now since composer required to add vendor directory.

duaelfr’s picture

dcrocks’s picture

Category: Task » Bug report

Since an uninstall, install cycle on this theme results in incorrect output, this should be in the bug queue, not task.

joginderpc’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +issue not replicated
StatusFileSize
new84.26 KB

As per this issue i had verified and every thing working fine with using last comment #23 patch.

seven theme applied

dcrocks’s picture

I appreciate the review. If you have time, could you review the 2 related issues?

joginderpc’s picture

Thanks @drocks i had updated other related issue too please check once.

alexpott’s picture

Status: Reviewed & tested by the community » Needs review

I'm not convinced by this issue. Firstly the config should depend on Seven so having it in config/install should not be a problem for some of them - but there's a wider issue. These blocks are configured depending on what modules standard installs. This is standard config - not Seven's. If you install Seven after installing the minimal profile I would expect to do the block placement myself.

Setting back to "needs review" for more opinions.

One thing that is apparent is that when uninstalling a theme we should list the configuration that will be deleted so the user knows this is not a reversible step. At the moment that does not appear to be happening.

dcrocks’s picture

Just a couple of points.
These block config files are specifically for the themes they are defined for, not for the install profiles. They are meaningless to the install profiles if their theme is not also activated by the profile. They were previously in the profile's config directory because that was the only place they could be activated during install.

It has always been bad DX for core themes needing a visit to admin for block placement on install/reinstall. Block inheritance is a nice convenience but really is a nuisance when developing new themes or when working with established themes. Bartik, et all, should always work out of the box, especially for those new to drupal. What kind of experience is drupal providing when a theme becomes broken just because it has gone thru an uninstall/install cycle.

As has been pointed out elsewhere, a theme shouldn't be installed if its dependencies aren't met. Using 'config/optional' instead of 'config/install' provides a soft failure instead of a hard one. Also, bartik and stark are too often used in tests when those tests have absolutely no dependence on those specific themes. These constantly evolving themes are being used instead of static test system themes, resulting in completely unnecessary test failures.

alexpott’s picture

@dcrocks hmm actually I agree with you about the way the block module responds to a theme install. Perhaps I'm wrong here - you're right that in D7 terms themes couldn't do this because they had no installation status and no they have so perhaps this is fixable.

In the Seven example here only the help block is dependent on something that is not required so it is the only one that needs to be in config/optional - the others should be able to in config/install.

Also I'm pondering about the affect of this change on existing install profiles.

Jeff Burnz’s picture

These blocks are configured depending on what modules standard installs. This is standard config - not Seven's. If you install Seven after installing the minimal profile I would expect to do the block placement myself.

Bascially the way I see this is that minimal install does mean minimal site (post install). Seven has no config for minimal therefor when installed later on it gets the default block placement so blocks end up in the wrong regions - I'm not convinced this is good UX. When you enable a core theme I would argue the expectation is that it's a properly working theme, and for Seven that means we get tabs etc in the right place, regardless of what profile we started out with.

In the Seven example here only the help block is dependent on something that is not required so it is the only one that needs to be in config/optional - the others should be able to in config/install.

Block module is optional, so to me the sensible thing is to have its config in /optional. I would think that if you're installing Block it's for a reason (you want blocks), additionally minimal is a crippled site (you can't even place a block with Stark) so one assumes nearly everyone who goes minimal (and keeps block module installed) enables an admin theme pretty quickly thereafter so it should just work (as "admin").

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

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now 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.

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

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now 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.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now 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.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now 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.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now 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.

jacine’s picture

I was surprised to learn this config resides in the standard profile. It seems appropriate to have it reside within Seven. As far as config/install vs config/optional, I can see both points in #31 and #32.

From #31:

In the Seven example here only the help block is dependent on something that is not required so it is the only one that needs to be in config/optional - the others should be able to in config/install.

From #32:

Block module is optional, so to me the sensible thing is to have its config in /optional.

I think the end result of these is going to be the same, in 99.9% of use cases, as most probably use the Block module... But, I guess technically #32 is correct, given Block module can be uninstalled.

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

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

alexpott’s picture

Here's a thought - if we moved the config into the profile's optional configuration then it would be reinstalled with the theme but it would avoid polluting the theme with config that's dependent on an install profile.

This config does not belong in the theme - it is profile specific.

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

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

andrewmacpherson’s picture

Status: Needs review » Needs work
andrewmacpherson’s picture

The use case assumed here is "uninstall, then re-install". However there's a broader use case: sites where Seven was never installed in the first place. For example...

  1. A site-builder starts with the Minimal install profile, and immediately wants an admin theme.
  2. A site-builder starts from a distro, and is dismayed to find it uses a custom/contrib admin theme which they aren't familiar with. They'd rather have the default core admin theme.
  3. An agency uses a contrib admin theme for all their clients. One of the support developers hates this, because it hides all the form descriptions. So the first thing they do after fetching a DB dump is enable Seven. They do this for every website, every DB dump.

The thing these all have in common is they want the familiar default admin UI quickly, and they want it to just work without manually setting blocks up. Regardless of which profile was used.

A profile is an opinionated assortment of config, to answer the question: "what sort of site is this for?". I don't think the blocks which Seven gets are profile-specific in that sense. Rather these are the minimum blocks every site needs to make the Drupal admin UI usable: local tasks and actions, messages, breadcrumbs, and help. Apart from the help block, they all come from system module.

Bartik in Standard gets a few extra ones which you can argue are profile-specific, such as the search block. Umami certainly has a lot of profile-specific ones; distros likewise.

So it sounds to me like a few important blocks (mostly from system module) belong in the theme's config, and profiles add the opinionated choices.

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

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now 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.

pameeela credited dxvargas.

pameeela’s picture

Added #3099503: Seven theme: blocks configuration missing if exported to profiles as a duplicate and will close that. Also added dxvargas as a contributor, he should get credit when this gets in for patches on the duplicate issue.

pameeela’s picture

Issue tags: -issue not replicated +Bug Smash Initiative

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

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

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

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.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.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

DieterHolvoet made their first commit to this issue’s fork.

dieterholvoet’s picture

StatusFileSize
new9.95 KB

I applied the latest patch to an issue fork. I also added a patch without renames, in case those cause troubles when applying through cweagans/composer-patches (they do for me)

smulvih2’s picture

Patch #55 works for me on 9.3.9.

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

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now 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.

longwave’s picture

Title: Move Seven block config into the Seven theme » Move Claro standard profile block config into the Claro theme
Component: Seven theme » Claro theme

In #3277057: Make Claro the default admin theme in Standard profile we changed the default admin theme from Seven to Claro, and the Seven block config in the profile for Seven was repurposed for Claro.

Next steps here are to test the initial bug here against Claro and see if it is reproducible there.

Liam Morland made their first commit to this issue’s fork.

liam morland’s picture

The files were renamed from seven to claro in #3277057: Make Claro the default admin theme in Standard profile and then deleted in #3278565: Remove Claro block configuration from Standard. That is why the patch no longer applies. Is there anything more for this issue to do?

ameymudras made their first commit to this issue’s fork.

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

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now 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.

liam morland’s picture

These files don't exist anymore; see #60. As far as I can tell, this issue should be closed as outdated.

Version: 10.1.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, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

dww’s picture

Status: Needs work » Closed (outdated)

Indeed, the block config has been in core/themes/claro/config/optional since #3079738: Add Claro administration theme to core. There's nothing to move. This bug has fixed itself in the intervening years...