Problem/Motivation

In D7, Features was used to install some default config for traditionally non-exportable things, like user roles.
These are now config entities.

And Strongarm is used for overriding defaults for variables.
These are now vanilla CMI values.

Proposed resolution

Determine a subset of the core-provided config entities that Features handled, and provide conversions.
A good first example is hook_user_default_roles() to user.role.*.yml.
Reuse the variable_*et upgrade to turn strongarm into CMI.

Remaining tasks

User interface changes

API changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tim.plunkett’s picture

Status: Active » Needs review
FileSize
2.28 KB

Here's an example conversion.

tim.plunkett’s picture

+++ b/src/Plugin/DMU/Converter/HookUserDefaultRoles.php
@@ -0,0 +1,36 @@
+        $user_role['id'] = $user_role['machine_name'];
+        $user_role['label'] = $user_role['name'];

These two values are required. What should I do if they aren't present? Skip that single role and move on, mark it in some way, or bail out completely?

Also before committing, we should decide if contrib conversions really belong in DMU directly, or if they should be a submodule as part of DMU, or standalone.

phenaproxima’s picture

Contrib conversions should be submodules.

If both values aren't present, I'd recommend skipping that single role, and setting $this->error('Could not convert xyz...') so it shows up in the console.

tim.plunkett’s picture

FileSize
6.18 KB
7.04 KB

Well we can't use a submodule until #2375543: Provide an easy way for modules providing DMU integration to alter what is stored in DMU/config/install (or something like it). Here it is refactored a bit, and with a unit test.