Problem/Motivation

In my module I have file in config\install

When I run kernel test I have:

Drupal\Core\Config\Schema\SchemaIncompleteException : Schema errors for core.entity_form_display.node.rfq.default with the following errors: core.entity_form_display.node.rfq.default:content.rg_rfq_phone.third_party_settings.conditional_fields.297afe57-fca6-49d3-b03c-74d7e911b59f.settings.values variable type is string but applied schema class is Drupal\Core\Config\Schema\Sequence

In core.entity_form_display.node.rfq.default.yml I have:

  rg_rfq_phone:
    weight: 6
    settings:
      placeholder: ''
    third_party_settings:
      conditional_fields:
        297afe57-fca6-49d3-b03c-74d7e911b59f:
          dependee: rg_rfq_contact_type
          settings:
            state: visible
            condition: value
            grouping: AND
            values_set: 1
            value: ''
            values: "call\r\nwhatsapp"
            value_form:
              -
                value: call
              -
                value: whatsapp
            effect: fade
            effect_options: {}
            selector: ''
            reset: false
          entity_type: node
          bundle: rfq
    type: telephone_default
    region: content
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

super_romeo created an issue. See original summary.

super_romeo’s picture

Issue summary: View changes
super_romeo’s picture

Issue summary: View changes
heddn’s picture

Status: Active » Closed (duplicate)
Related issues: +#2948786: Fix config schema for value_form component
sorlov’s picture

Status: Closed (duplicate) » Needs work
StatusFileSize
new42.3 KB

@heddn, described issue was about values key in settings, not value_form

For example, when I made next set of values in condition

configuration screenshot

I got next in config

settings:
            state: visible
            condition: value
            grouping: AND
            values_set: 3
            value: ''
            values: "2\r\n3\r\n4"
            value_form: {  }
            effect: show
            effect_options: {  }
            selector: ''

You can see values: "2\r\n3\r\n4" here, while according to config schema, values is supposed to be sequence of string values

sorlov’s picture

Status: Needs work » Needs review
StatusFileSize
new681 bytes

Status: Needs review » Needs work

The last submitted patch, 6: conditional_fields-3245121-6.patch, failed testing. View results

damienmckenna made their first commit to this issue’s fork.

damienmckenna’s picture

Status: Needs work » Needs review

I turned patch #6 into a MR.

damienmckenna’s picture

I found that I also had to edit the default settings in src/Conditions.php, otherwise the bug persisted.

damienmckenna’s picture

It might be worth adding an update script to fix existing configuration.

damienmckenna’s picture

I think the test failures are related to changes in core, rather than something from this MR.

benstallings’s picture

Status: Needs review » Reviewed & tested by the community

This looks correct and ready to merge.