Conditional Fields not showing for multiple value select fields on node edit form with option 'Any of these values (OR)...'

Created on 27 January 2020, almost 5 years ago
Updated 10 May 2023, over 1 year ago

If the visible state of a (select) field 1 depends on another select field 2 that can have multiple values, field 1 remains hidden when you open the node edit form, although field 2 has values selected from the set of values (field 1 however shows if you then change the value(s) of field 2).

The patch from https://www.drupal.org/project/drupal/issues/1149078 🐛 States API doesn't work with multiple select fields Needs review fixes a related issue in Drupal core (The States API won't currently pick up the value of a select field with #multiple = TRUE option.), but the #state syntax of the conditional module select handler has to be adapted accordingly.

Field 1 condtion configuration:

conditional_fields:
        <uuid>:
          dependee: field_xyz
          settings:
            state: visible
            condition: value
            grouping: OR
            values_set: 3
            value: ''
            values: "2\r\n8"
            value_form: {  }
            effect: show
            effect_options: {  }
            selector: ''
          entity_type: node
          bundle: xyz
    type: options_select
    region: content

Field 2 configuration:

field_xyz:
    weight: 3
    settings: {  }
    third_party_settings: {  }
    type: options_select
    region: content
🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇭Switzerland boromino

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024