I am receiving the following issue when attempting to run a browser test installing the configuration of the r4032login module.
Schema errors for r4032login.settings with the following errors: r4032login.settings:access_denied_message_type variable type is string but applied schema class is Drupal\Core\Config\Schema\Mapping, r4032login.settings:default_redirect_code variable type is string but applied schema class is Drupal\Core\Config\Schema\Mapping, r4032login.settings:_core missing schema, r4032login.settings:langcode missing schema
/....../web/core/lib/Drupal/Core/Config/Testing/ConfigSchemaChecker.php:93
/....../web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php:111
/....../web/core/lib/Drupal/Core/Config/Config.php:227
/....../web/core/lib/Drupal/Core/Config/ConfigInstaller.php:325
The issue seems to be caused by the settings schema. I spotted three issues there:
- The access_denied_message_type property is defined as
access_denied_message_type: type: mapping label: "User login 'access denied' message type" mapping: error: type: string label: 'Error' warning: type: string label: 'Warning' status: type: string label: 'Status'
and in the r4032.settings.yml file it is defined as
access_denied_message_type: 'error'
while, if we follow the mapping above, it would be
access_denied_message_type: error:error
The type should change to string. The value is assured by the options field in the admin settings form. Further validation can be set but I do not think this is that necessary.
-
The access_denied_message_type property is defined as
default_redirect_code: type: mapping label: 'HTTP redirect code' mapping: 302: type: integer label: '302 Found' 301: type: integer label: '301 Moved Permanently'
and in the r4032.settings.yml file it is defined as
default_redirect_code: '302'
while, if we follow the mapping above, it would be
default_redirect_code: 302: 302
-
The r4032login schema itself is defined as
r4032login.settings: type: mapping label: 'Redirect 403 to User Login (r4032login) settings'
This is because it is expecting a config_hash.
The settings should be defined as type 'config_object'.
Proposed solution
- The access_denied_message_type type should change to string. The value is assured by the options field in the admin settings form. Further validation can be set but I do not think this is that necessary.
- The default_redirect_code should change to integer. The value is assured by the options field in the admin settings form. Further validation can be set but I do not think this is that necessary.
A caution here: I do not know if that will cause any issues on updates since the value in r4032login.settings.yml was '302' which is a string but should be 302 which is an integer. - Change the settings schema to be of type 'config_object' as it normally should be.
Comment | File | Size | Author |
---|---|---|---|
#2 | schema_fix-2833695-2-D8.patch | 1.9 KB | idimopoulos |
Comments
Comment #2
idimopoulos CreditAttribution: idimopoulos commentedI am submitting a patch to assure the proper schema.
Comment #3
idimopoulos CreditAttribution: idimopoulos commentedSetting to needs review.
Comment #4
claudiu.cristeaPerfect!
Comment #5
pfrenssen+1
Comment #7
bdone CreditAttribution: bdone as a volunteer commentedcommitted, thanks!