Modules current state doesn't contain configuration schema

CommentFileSizeAuthor
#3 3082312_3.patch633 bytesYurkinPark
#2 3082312_2.patch633 bytesYurkinPark

Comments

YurkinPark created an issue. See original summary.

YurkinPark’s picture

Status: Active » Needs review
StatusFileSize
new633 bytes
YurkinPark’s picture

StatusFileSize
new633 bytes

Sorry, one problem was detected in previous version

mlncn’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

  • mlncn committed adbd990 on 8.x-1.x authored by YurkinPark
    Issue #3082312 by YurkinPark, mlncn: No configuration schema
    
mlncn’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

gnuget’s picture

This still needs work.

Running tests while using this module triggers this error:

Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for registration_role.setting with the following errors: registration_role.setting:role_to_select.administrator variable type is integer but applied schema class is Drupal\Core\Config\Schema\String

This is because the configuration looks like this:

 Drupal\Core\Config\Config {#12183
     role_to_select: [
       "contributor" => "contributor",
       "administrator" => 0,
     ],

So, when the schema is applied contributor (the selected role) is indeed a string but administrator is 0 which is integer and breaks the expected schema.

I'm going to create a new issue with the fix.

andypost’s picture

It needs follow-up to fix form and provide post update hook to remove keys with 0 values, as discussed in slack

@gnuget nice catch!

gnuget’s picture

I asked in the Drupal Slack and it seems that given that we cannot know the type of the values it is better to fix the configuration to make it match with the schema.

So in my fix instead to fix the schema I will fix how is store the configuration :-)