Problem/Motivation
At #3082312: No configuration schema the configuration schema was added, the problem is that the configuration saved is different than what the schema expets:
Schema:
registration_role.setting:
type: config_object
label: 'Registration role settings'
mapping:
role_to_select:
type: sequence
label: 'User roles'
sequence:
type: string
label: 'Role'
registration_mode:
type: string
label: 'Registration mode'And the configuration that is saved is something like this:
role_to_select:
role1: role1
role2: 0
role3: 0
registration_mode: 'user'
This breaks the `role_to_select` because it expects a string and some values (the unselected ones) are 0.
This in particular breaks when a test is run that depends on this module:
Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for registration_role.setting with the following errors: registration_role.setting:role_to_select.role1 variable type is integer but applied schema class is Drupal\Core\TypedData\Plugin\DataType\StringData,
Proposed resolution
Make the configuration match with the schema, removing the roles that are unselected from the configuration (right now are saved as 0)
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3155688-3.patch | 1.88 KB | gnuget |
Comments
Comment #2
gnugetComment #3
gnugetPatch attached.
Comment #4
mlncn commentedLooks good!
Comment #6
mlncn commented