This blocks #2571235: [regression] Roles should depend on objects that are building the granted permissions and hence at least a major because it is blocking a critical.

Problem/Motivation

Profiles can override configuration used in an install. For example, a profile can provide a user.role.anonymous that is used instead of the one in user/config/install. This works fine at the moment because user roles have no dependencies. But #2571235: [regression] Roles should depend on objects that are building the granted permissions will break this because that adds them and as user is installed right after system there is no way this can work without causing an \Drupal\Core\Config\UnmetDependenciesException error. This behaviour is tested in \Drupal\config\Tests\ConfigInstallProfileUnmetDependenciesTest.

Proposed resolution

This is not an ideal situation as it means we can't really add any new dependency information without breaking install profiles that do this. According to @Berdir we've done this several time over the 8.x dev cycle.

Instead of replacing the configuration during a module install, we can:

  • install the configuration provided by module during module install
  • install the configuration provided by the profile during profile install - where we can update the configuration entity instead.

Note this only occurs for configuration entities as simple configuration cannot have dependencies and so profile overrides will still occur when a module is installed.

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

Previously, modules could make changes to configuration a profile is overriding during their install. This has changed in 8.8 and profile configuration overrides are now installed at the end of an installation. Any profiles that previously modified their configuration during installation must update their configuration so that it contains the final configuration that is desired at the end of installation. Refer to the change record for more information and suggestions for updating your profile's configuration.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

Berdir’s picture

> This is not an ideal situation as it means we can't really add any new dependency information without breaking install profiles that do this. According to @Berdir we've done this several time over the 8.x dev cycle.

Clarification, what we did several times was breaking customized/overidden config in install profiles for other reasons, usually config schema changes, not specifically by adding new dependencies (I think, can't remember such a case).

alexpott’s picture

Status: Active » Needs review
Issue tags: -Needs tests
FileSize
5.97 KB

Here's a patch.

We need to decide if it is worth excluding simple configuration from being written again when the profile is installed. In my mind the additional complexity of doing that is not worth it.

Although user roles don't currently support dependencies the test currently assumes that they do - this is okay because the ConfigInstaller has to use to assume any config entity with a dependencies key is correct because it is operating on them before the entity class / module that supports them is even installed.

One thing that is really nice about this change is that the error message tested by \Drupal\config\Tests\ConfigInstallProfileUnmetDependenciesTest is now actually correct! The configuration with the unmet dependencies is being provided by the testing_config_overrides profile and not the User module.

It'd be great if @Berdir could test this on a real custom install profile with a metric tonne of config.

alexpott’s picture

Issue summary: View changes
alexpott’s picture

One thing that might be good to explain is why does this work. Reviewers might be thinking I thought we had \Drupal\Core\Config\PreExistingConfigException() that'd be thrown in this situation. Well. Because we don't throw that for install profiles...

    // Install profiles can not have config clashes. Configuration that
    // has the same name as a module's configuration will be used instead.
    if ($name != $this->drupalGetProfile()) {
      // Throw an exception if the module being installed contains configuration
      // that already exists. Additionally, can not continue installing more
      // modules because those may depend on the current module being installed.
      $existing_configuration = $this->findPreExistingConfiguration($storage);
      if (!empty($existing_configuration)) {
        throw PreExistingConfigException::create($name, $existing_configuration);
      }
    }

And later when writing the configuration entities we do:

        // It is possible that secondary writes can occur during configuration
        // creation. Updates of such configuration are allowed.
        if ($this->getActiveStorages($collection)->exists($name)) {
          $id = $entity_storage->getIDFromConfigName($name, $entity_storage->getEntityType()->getConfigPrefix());
          $entity = $entity_storage->load($id);
          $entity = $entity_storage->updateFromStorageRecord($entity, $new_config->get());
        }
        else {
          $entity = $entity_storage->createFromStorageRecord($new_config->get());
        }

So we actually do an update correctly.

effulgentsia’s picture

Maybe instead of replacing the configuration we can just install the configuration from the module and then when the install profile is instead we can update the configuration entity instead.

Yes, +1. I think that's much more logical. I'm actually surprised it's not how our installer already works. If we do it this way, is there any BC break to contrib/custom install profiles?

Berdir’s picture

We'll have to figure that out. I have two large and complex install profiles that I can test this with, and it would probably make sense to test it with others as well, lightning, thunder, ...

effulgentsia’s picture

Another possibility is perhaps for each config item in the profile, to install it as soon as all of its dependencies are met? So if user.role.authenticated.yml depends on tour module, then install it right after installing tour module? Not sure if that adds more complexity to the installer than is worth it, but it might be a smaller BC break that way, since the order of config installation wouldn't change for the cases where there aren't dependencies on any modules other than the provider.

alexpott’s picture

@effulgentsia I'd rather not have to do that kinda of working out. On one hand, we kinda have the plumbing though as that is how optional configuration works. And I agree it is potentially a smaller change. But on the other, the big part of the change is not the point at when something exists but the fact something is updated during an install. At the moment these things are created once whereas with this change they are updated when the profile is installed. And as they are provided by the install profile it kinda makes sense to have them installed then.

I think in an ideal world the ConfigImporter and drupal installation work in the same way i.e. #2788777: Allow a site-specific profile to be installed from existing config and this issue would be moot.

jibran’s picture

alexpott’s picture

@jibran I don't think so. The shortcut issue is really about the relationship between content and config and the fact we can only create content in install hooks.

nevergone’s picture

Please review this issue. I tested Drupal 8.4.2 with custom install profile and works well!

Pasqualle’s picture

FileSize
403 bytes

Another use case when config can not be installed, see field.storage.node.body.yml

- The config has a dependency on node and field_permissons modules.
- The node module is always installed before field_permissions module.
- The field.storage.node.body.yml config is installed with node module, which results in:

Configuration objects provided by node have unmet dependencies: field.storage.node.body (field_permissions)

Based on this example it is possible to create a simple test profile which will fail to install (without the patch from this issue).

Berdir’s picture

Started testing this with a large custom install profile.

Was able to move quite a bit of PHP code that changed form/view displays and some other settings to plain config overrides.

I'm also seeing some test fails though, caused by interesting race conditions. Will look more into them, but here's an example:

I'm overriding mailsystem.settings in the install profile. Additionally, swiftmailer_install() adds some additional keys to it in hook_install().

In HEAD, what happens is that mailsystem gets installed, my overridden config gets used, then swiftmailer_install() runs and adds additional things. With the patch, what happens is that mailsystem gets installed with the default config, then swiftmailer_install() runs and adds its stuff and only after that my install profile override kicks in and replaces the whole mailsystem.settings config, including removing the additional keys added by swiftmailer_install(). If it always worked like that then fine, I would have just overriden the final config, but the problem is that this is now changing. It's a change in the installer I suppose, so technically excluded from BC but still. We're introducing something to limit the BC impact of #2571235: [regression] Roles should depend on objects that are building the granted permissions but break a lot of stuff in the process :-/

A similar, more problematic example is system.site, I'm also overriding that to set a few custom settings, but that now means that the generated site UUID is lost. Something is also breaking Ckeditor.

effulgentsia’s picture

I wonder if the BC break of #14 is reason enough to consider #8?

effulgentsia’s picture

Though I also do think that the case described in #14 is a bug with the install profile. If the profile includes the installation of swiftmailer, then the overridden config provided by the profile *should* contain the keys needed by swiftmailer. So it's a legitimate question as to whether or not we want to preserve BC for a profile that's not doing so.

alexpott’s picture

I think #14 is simple to fix - will look at later. The problem with #8 is that things depend on their config entities in their hook_install() if the config entity is in config/install and changing that is way more of an API break than the patch in #3.

Berdir’s picture

> Though I also do think that the case described in #14 is a bug with the install profile. If the profile includes the installation of swiftmailer, then the overridden config provided by the profile *should* contain the keys needed by swiftmailer.

I'm not sure if it's a bug or not, because right now, the install profile can't prevent swiftmailer_install() from acting on it, and depending on what is changed it exactly, already having the changed config might actually result in an unexpected behavior. Maybe not in this case, but there could be others.

Whether or not it is a bug, it is definitely a change, and my point is that we're basically doing this issue to prevent workarounds and BC breaks that #2571235: [regression] Roles should depend on objects that are building the granted permissions would cause. And while the existing workarounds are annoying (this patch allowed me to delete dozens of ugly PHP code in $profile_install()), the advantage of them is that they fail hard, with a pretty clear error message.

The conflicts caused by this are much harder to detect, the installer went through without errors and I likely wouldn't have noticed those problems until much later without my behat tests. My point is basically that I'm not sure if it's worth to make this change, if we just trade some workarounds with others.

Maybe we could support both, by supporting a "postinstall" folder in the install profile? Then you can put things by default in install, and if it fails you have the option to put it there, files there could of course have the exact issues described above, but you only need to use it if you have to it's not something that's suddenly changing in a minor updat for an existing install profile. Sure, it's not a perfect solution, but our install system is far from perfect and *maybe* all those problems will just go away when we only support config import based installers?

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.

alexpott’s picture

Funnily enough #8 is kinda how #2930996: Config installer doesn't install possible installable config is working. However I'm not sure that it is going to solve the issues #14 raises if we made profile overrides work similarly. Because we have no guarantee that the config entities will be installed early enough that things like #14 won't happen.

I'm not sure I agree with @Berdir's we are only doing this to work around prevent workarounds. The point is that a profile's configuration entities are only really valid once the profile has been fully installed. And the profile is only installed after all the modules it lists are installed.

I think the idea of a post-install folder just adds unnecessary complexity to an already complex situation.

I wonder if there is another way to resolve #14. Essentially we have undetected bug here because the moment after you've installed you have configuration change and you've done nothing. I.e. the profile's configuration does not reflect the final state after an install.

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.

DevPilot’s picture

Some food for thought on this issue: I had created an install profile by exporting config very close to these instructions https://www.drupal.org/docs/8/creating-distributions/how-to-write-a-drup...

With 8.6, I received these dependencies errors on almost everything until I applied this patch (applied manually on 8.6).

Not sure if this means a totally different method for configuration on an install profile but I even mimicked the demo_umami profile and I can't seem to pin down anything specific that I need to do different.

Is there something I may be missing?

clairedesbois@gmail.com’s picture

Hello everyone,

I have the problem on the profile I create presently. I updated the default configuration of Image module to add a manual crop. Example of files:

langcode: fr
status: true
dependencies:
  config:
    - crop.type.crop_1x1
  module:
    - crop
name: large
label: 'Large (480×480)'
effects:
  ddd73aa7-4bd6-4c85-b600-bdf2b1628d1d:
    uuid: ddd73aa7-4bd6-4c85-b600-bdf2b1628d1d
    id: image_scale
    weight: -9
    data:
      width: 480
      height: 480
      upscale: false
  7cd03233-541d-472e-851c-de8945ee6709:
    uuid: 7cd03233-541d-472e-851c-de8945ee6709
    id: crop_crop
    weight: -10
    data:
      crop_type: crop_1x1

But despite of I put the configuration files in my optional directory config of my profile, I still have this error when I test my installation profile.

Drupal\Core\Config\UnmetDependenciesException: Configuration objects provided by image have unmet dependencies: image.style.large (crop.type.crop_1x1, crop) in Drupal\Core\Config\UnmetDependenciesException::create() (line 98 of /var/www/html/core/lib/Drupal/Core/Config/UnmetDependenciesException.php).

I test the patch, if the error no longer happens, crop module is correctly installed and configured but the image styles don't include my crop style. So I suppose my optional configurations for image styles aren't applied for default style (these one install by the module image, this is to say large, medium and thumbnail). But it's correctly configured for custom styles I added.

I suppose I need to put this issue in "Need works" like the patch doesn't work as expected in my case.

Pasqualle’s picture

@Calystod:
Do you have the "crop.type.crop_1x1" config also included in you profile's config/install directory?

DanielVeza’s picture

Here is a quick patch I've used on our profile to get it up and running on 8.6.1. Will come back and add the tests in, they're missing at the moment.

Patch is mostly a reroll of #2.

clairedesbois@gmail.com’s picture

@Pasqualle Yes, it's present in the install directory. I do the test to put it in optional directory too, but it doesn't fix the problem.

My crop type is correctly created but not included in the image styles large, medium and thumbnail despite configuration files But it is correctly included in custom styles which aren't by default with the image module)

clairedesbois@gmail.com’s picture

Status: Needs review » Needs work

@DanielVeza Your patch doesn't work with my profile. I have the error of unmeetable dependencies with this one.

clairedesbois@gmail.com’s picture

I reroll the patch of alexpott for Drupal 8.6.x

It doesn't fix the problem I notice in #23 where a part of my optional configurations aren't applied but the bug of unmeet dependencies doesn't happen with it.

When I will have more time, I will look for the bug I personally met if nobody fix it before.

alexpott’s picture

Status: Needs work » Needs review
FileSize
6.09 KB

Rerolled #3 on top of 8.7.x and improved the code comments.

alexpott credited hchonov.

alexpott’s picture

hchonov’s picture

@Calystod, the problem you describe isn't related to the current issue. Optional configs are being installed at the end of the profile installation, but only those optional configs which haven't been created until that moment. And here is the problem in more details - image.style.large.yml is installed when the image module is being installed, but you've placed this config into the profile's optional config storage. This case is documented in \Drupal\Core\Config\ConfigInstaller::installOptionalConfig():

    $list = array_unique(array_merge($storage->listAll(), $optional_profile_config));
    $list = array_filter($list, function ($config_name) use ($existing_config) {
      // Only list configuration that:
      // - does not already exist
      // - is a configuration entity (this also excludes config that has an
      //   implicit dependency on modules that are not yet installed)
      return !in_array($config_name, $existing_config) && $this->configManager->getEntityTypeIdByName($config_name);
    });

So as the config name already exists it is being ignored.

The solution to your problem is to put the config into the profile's install config storage. If for some reason you cannot do this, then it is better to create a dedicated issue.

---------

+++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php
@@ -270,7 +274,24 @@ protected function getConfigToCreate(StorageInterface $storage, $collection, $pr
+        // Install profiles can provide configuration overrides that have
+        // dependencies that can not possibly be installed. Therefore, only
+        // override simple configuration.

Nice! I didn't thought about simple configuration in the other issue, but the new approach of the current issue solves a problem that I had the last week exactly because of this missing piece in the other patch.

I totally like the current state of the patch here.

@alexpott++

Could you please upload a test only patch? Beside that the issue is RTBC for me!

hchonov’s picture

+++ b/core/modules/config/tests/src/Functional/ConfigInstallProfileUnmetDependenciesTest.php
index 0000000000..1b210736be
--- /dev/null

--- /dev/null
+++ b/core/profiles/testing_config_overrides/config/install/user.role.authenticated.yml

Oh, what is that needed for?

Berdir’s picture

As discussed before in #14-20, I tested this again by applying the patch and comparing the installed configuration, before and after applying the patch.

It still seems to me like we're trading one problem for another. This does indeed allow to put configuration overrides with additional dependencies into config/install instead of requiring code in hook_install(), but by installing them at the end, there are also several cases where dynamic configuration by modules gets overwritten as mentioned there.

Examples:

* The swiftmailer case mentioned in #14. This can be worked around by having the correct configuration upfront, but again, these things are quite hard to detect.

* No uuid in system.site if you have that customized. This is IMHO a pretty big problem, I don't see a workaround for this?

* It is somewhat common to grant auth/anon user roles certain permissions by default in hook_install() of your module, eu_cookie_compliance does that, node in core does, userprotect does and so on. You can easily update your overridden config in your install profile as you are depending on those modules but it's easy to miss if e.g. a new module you add does that.

alexpott’s picture

No uuid in system.site if you have that customized. This is IMHO a pretty big problem, I don't see a workaround for this?

system.site overriding is unchanged by the patch above. If you override that you need to have the UUID in it now - this patch does not change that.

Re the switfmailer, roles stuff - I think if your profile overrides configuration it is taking responsibility for overriding it correctly. It's like highlander - there can be only one :)

Berdir’s picture

> system.site overriding is unchanged by the patch above. If you override that you need to have the UUID in it now - this patch does not change that.

Nope, it's not unchanged :)

I have a system.site override in my profile to set some default settings in there. Right now, that's imported when system.module is installed and then system_install() runs and sets the uuid.

With this patch, the default system.site.yml is imported, then system_install() runs, sets the uuid and then later on, my config is imported, overwriting those dynamic keys, resulting in:

$ diff -up config_sync_old/system.site.yml config_sync/system.site.yml 
--- config_sync_old/system.site.yml	2018-10-12 08:30:57.839775204 +0200
+++ config_sync/system.site.yml	2018-10-12 09:17:06.686277539 +0200
@@ -1,4 +1,4 @@
-uuid: 66a1a5da-0358-4f3b-9ed7-38f5d77fbaff
+uuid: ''
 name: Site-Install
 mail: admin@example.com
 slogan: ''
alexpott’s picture

I've added a test for #37 - doesn't fail :( so not sure what is going.

hchonov’s picture

system.site.yml is a simple configuration and as such its configuration override from the profile will be used when the system module is being installed as a part of profile installation. The config is created only once and never touched again by the config installer during profile installation, which is why it is safe to modify simple configuration in the install hook of the module provider of that simple configuration.

It is not surprising that the test doesn't fail as this is the expected behavior for simple configuration, which is not changed by the current patch. The described problem might occur only with config entities - but it is either this or having profiles which cannot be installed at all because of unmet dependencies. The latter can be solved too, but it requires a much more complicated dependency resolution.

#37 sounds like the patch from the duplicate issue, which uses profile overrides for all configs without exception. @Berdir, in what kind of setup are you testing the patch?

Berdir’s picture

I used the patch from #28 because I was testing this on 8.6. @alexpott mentioned that other changes in might have affected this, specifically the recent one about not re-importing configuration from the install profile (#3002655: Optional profile configuration can be unexpectedly recreated after being deleted, which has been backported but is not in a stable release yet)

With that, I'm OK to RTBC this once we have a change record that explains a bit what could change because of this for install profiles. It should specifically mentioned the auth/anon user role and that the config override then trumps all permissions that are dynamically added by modules in hook_install().

Despite this being a bug, it should possibly only be added to 8.7 because it can cause those behavior changes?

hchonov’s picture

Despite this being a bug, it should possibly only be added to 8.7 because it can cause those behavior changes?

👍

pfrenssen’s picture

+++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php
@@ -270,7 +274,24 @@ protected function getConfigToCreate(StorageInterface $storage, $collection, $pr
       if ($profile_storage->getCollectionName() != $collection) {
...
+      else {
+        // Allow install profiles to override configuration when installing
+        // extension after Drupal installation.
+        $data = $profile_overrides + $data;
+      }

This documentation is not entirely clear to me.

The use case for this is for the deployment of an update to an existing site that includes a new module.
The updated code containing the overrides for the new module would be deployed to the server and then the module would be enabled in a post-update hook.

Maybe something like this would be clearer?

        // Allow install profiles to provide overridden configuration for new
        // extensions that are being enabled after Drupal has already been
        // installed. This allows profiles to ship new extensions in version
        // updates without requiring additional code to apply the overrides.
nevergone’s picture

Will you be preparing for 8.7.0?

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.

DanielVeza’s picture

Is anybody else having issues with this patch? We use it in our profile and it appears it is no longer working - Although it does apply.

Strange thing, is that it works on PHP7.0 - Installing completes, anything above that and it no longer works. It's bizarre.

DanielVeza’s picture

pmagunia’s picture

The patch from #38 worked for me.

It applied applied cleanly to 8.8.x-dev which I tested on.

Thanks!

Andrew Answer’s picture

I confirm what patch #38 fix UnmetDependenciesException error with my installation profile.

yookoala’s picture

If you cannot provide some config on installation be cause it conflicts with installer, you should be able to override the settings after installation. For example, a hook that triggers after installation would be ideal if I want to standardize some values in `update.settings`.

Alternatively, the installer should merge the default configurations with the existing one without overwriting.

alexpott’s picture

Rerolled on 8.8.x

alexpott’s picture

Issue summary: View changes

Updated issue summary to be a but clearer about the solution.

alexpott’s picture

@Berdir I've created the change record - perhaps you can review it? https://www.drupal.org/node/3086614

alexpott’s picture

Issue summary: View changes

Status: Needs review » Needs work

The last submitted patch, 50: 2922417-2-50.patch, failed testing. View results

alexpott’s picture

Status: Needs work » Needs review
FileSize
854 bytes
7.7 KB
alexpott’s picture

Incorporating @pfrenssen's feedback from #42

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Added a paragraph on specific suggestions and commands that people can use to diff and copy their install profile config. A bit uncommon I guess for a change record, but it's a bit an untypical change record anyway and I did the testing/research with that and thought it might help someone :)

As I said in #40, RTBC now that we have a change record. #55 passed, #56 is just documentation changes.

Off-topic: I still don't really get how default_config_hash stuff is supposed to work exactly. All my files changed on that, even if nothing else changed, I suppose because the uuid was added. But should the default config now have that or not.. and if not, then what's the point? So many questions :)

catch’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php
@@ -271,7 +275,26 @@ protected function getConfigToCreate(StorageInterface $storage, $collection, $pr
       }
-      $data = $profile_storage->readMultiple(array_keys($data)) + $data;
+      $profile_overrides = $profile_storage->readMultiple(array_keys($data));
+      if (InstallerKernel::installationAttempted()) {
+        // Install profiles can provide configuration overrides that have
+        // dependencies that can not possibly be installed. Therefore, only
+        // override simple configuration. As this method is called before
+        // modules are installed the only way to determine if they are
+        // configuration entities is the presence of a dependencies key.
+        foreach ($profile_overrides as $name => $override_data) {
+          if (!isset($override_data['dependencies'])) {
+            $data[$name] = $override_data;
+          }
+        }
+      }
+      else {
+        // Allow install profiles to provide overridden configuration for new
+        // extensions that are being enabled after Drupal has already been
+        // installed. This allows profiles to ship new extensions in version
+        // updates without requiring additional code to apply the overrides.
+        $data = $profile_overrides + $data;

Neither of these comments explain where profile overrides of configuration entities get applied. I understand from the issue that it's when the profile is installed, but it's not clear from reading the patch.

alexpott’s picture

Status: Needs work » Needs review
FileSize
2 KB
8.34 KB

Good point. I tried to improve the documentation to be more explicit.

  • catch committed 959f175 on 8.8.x
    Issue #2922417 by alexpott, Calystod, DanielVeza, Pasqualle, Berdir,...
catch’s picture

Status: Needs review » Fixed

That's much better thank you. Given it's only a docs change that I requested when the patch was RTBC, committing from needs review.

Committed 959f175 and pushed to 8.8.x. Thanks!

alexpott’s picture

Issue tags: +8.8.0 release notes

Tagging for release notes.

catch’s picture

Issue summary: View changes
DanielVeza’s picture

Nice work pushing the over the line team :). Another patch we can take out of our profile, always a win!

alexpott’s picture

For people who were still getting the UnmetDependencies exception even with this fix maybe you are experiencing #3087130: Profile configuration should be able to depend on optional configuration provided by modules

xjm’s picture

Status: Fixed » Needs work

The release note here could use a little work to clarify what the disruption is: What was it like before, and what is it like now? In particular:

Profile configuration should be as the profile author wants it to be at the end of the installation.

Does this mean that the API is supposed to do this now, or does this mean that a profile author (or module author, or someone) would need to make changes in order to accomplish this so that the fix from this issue works? Or something else?

xjm’s picture

See https://www.drupal.org/issue-summaries#release-notes for more info and examples on what people need from the release notes.

alexpott’s picture

Issue summary: View changes
Status: Needs work » Fixed

I've updated the release note to be clearer about who needs to think about this => profile author. And it is clearer on how the change might affect them.

xjm’s picture

Status: Fixed » Needs work

This sentence is still equally unclear though:

Configuration provided by the profile should be as the profile author wants it to be at the end of the installation.

The word "should" is ambiguous. Does it mean "we think the API will handle this for you, but YMMV"? Or does it mean, "You need to make changes to your profile's configuration"? Direct instructions will help. Something like:

Previously, configuration could be altered during profile installation. For $reasons, it is now required that configuration provided by the profile contain the final state in the exported configuration in the module. If your module alters configuration during installation, you must update it to the final state and remove any XYZ implementations that altered it previously. See the change record for suggestions on how to check your configuration and update it.

The wording could use some work still and maybe that isn't accurate but that's the kind of information we need. "Should" has multiple meanings depending on the reader's assumptions.

Also where does this change leave config installation that needs to be dynamic? Or can modules still dynamically alter config? It'd be good to clarify that.

xjm’s picture

Issue summary: View changes

Proposed update:

Previously, modules could make changes to configuration a profile is overriding during their install. This has changed in 8.8 and profile configuration overrides are now installed at the end of an installation. Any profiles that previously modified their configuration during installation must update their configuration so that it contains the final configuration that is desired at the end of installation. Refer to the change record for more information and suggestions for updating your profile's configuration.

It's much easier for people to understand in this order: before -> after -> what they need to change as a result -> where to get more info.

However, this still doesn't explain what to do about individual modules that may modify configuration during installation and how profile owners are supposed to handle that, or whether modules are affected or not. We should add that information to the release note when possible so that the alpha notes can be updated to clarify this. (And also validate that what I wrote above is actually accurate.)

andypost’s picture

alexpott’s picture

The release note has the text from #70 and it looks good to me.

alexpott’s picture

Status: Needs work » Fixed

Answering the other bits of #70. Modules don't need to make any changes - they can change the still configuration. It's up to the profile to ensure that any configuration entity override they have is exactly as the profile wants it to be. It depends on the how the profile wants it configuration as to whether or not the module's changes should be included. The CR contains help from a profile maintainer as to how to find such configuration.

Grayle’s picture

Wait, does this mean my profile submodules can no longer grant permissions to a certain role when they get installed during site installation, as the profile will in the end just overwrite it again with its base config for that role?

Nope, as I submitted it hit me, those submodules, and the form where users can pick 'em, happens later, after the pure "drupal install" step has already finished. Derp.

Status: Fixed » Closed (fixed)

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

OCTOGONE.dev’s picture

i have an error at drupal installation with my custom profil - version 2. i have successfully created a custom profile - version 1 - and installation is ok, thus i know how to do it and it works.

Note: i am installing the Drupal files with composer.

EDIT: i've found the problem, in the core.extension.yml the theme category is named theme , but in the YourThemE.info.yml it's named themes.