Problem/Motivation

Theme installation rebuilding the container seems to have broken situations depending on is_syncing: #3182716: block_theme_initialize should not create blocks during config sync

Steps to reproduce

Install an admin theme.
See blocks are set.

Proposed resolution

Persist the is_syncing flag.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3572171

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

nicxvan created an issue. See original summary.

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

berdir’s picture

Status: Active » Needs review

Pushed the changes I tested in #3105597: Stop copying block configuration from active theme when enabling a new theme into the MR.

Also updated the tested we added in the original issue to actually install a theme instead of just hardcoding the hooks. That then fails as expected on head.

I had to alter the test to use test_theme and not claro, because claro has its own config and then that also skips this logic.

berdir’s picture

I noticed that moduleInstaller already had its own version of this, I pushed that logic into DrupalKernel so it's shared between the two installers and works the same way.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

@berdir explained the test changes to me in Slack. I think they make sense, and are backed up by a comment so we don't accidentally regress it in the future.

What's more, I like this solution. It fixes the regression in block_theme_initialize(), makes the extension system more consistent, and allows me to continue my armed truce with that (disliked) function...without needing to harbor a full-on vendetta.

nicxvan’s picture

Thanks for taking care of this!

  • catch committed 30adfbbe on 11.3.x
    fix: #3572171 Persist is_syncing across container rebuilds
    
    By: nicxvan...

  • catch committed 3de7374d on 11.x
    fix: #3572171 Persist is_syncing across container rebuilds
    
    By: nicxvan...

  • catch committed c376f872 on main
    fix: #3572171 Persist is_syncing across container rebuilds
    
    By: nicxvan...
catch’s picture

Version: main » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to main, 11.x and 11.3.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

herved’s picture

Hi, this may have caused a regression, see #3584145: Call to member function removeComponent error after updating to 11.3.6 or something else needs updating/fixing.
There are quite a few modules using \Drupal::isConfigSyncing() in their hook_install, see here.

Any thoughts? Thank you

godotislate’s picture

Looks the following code path might have an issue:

  • ModuleInstaller::install(), with the $module_list passed to it having count > 1
  • This calls ModuleInstaller::doInstall(), then if the $module_list passed to doInstall() has count > 1, this calls ModuleInstaller::updateKernel([])
  • Which calls $this->kernel->resetContainer(), and resetContainer does not persist the config installer sync status