Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Fix suggested options in Field Conditions builder #10650

Merged

Conversation

duncanmcclean
Copy link
Member

This pull request fixes an issue with the suggested fields in the Field Conditions builder, after changes to how field options are stored in #10467.

Say you have a Button Group or Select field that looks like this:

-
  handle: developer_type
  field:
    options:
      -
        key: partner
        value: Partner
      -
        key: other
        value: Other
    default: other
    type: button_group
    display: 'Developer Type'

Then, when you add another field to the blueprint and configure a field condition, it'll save like this:

if:
  developer_type: 'equals Partner'

The saved value for this field condition is the "label" for the option, not the key or the value. This means the field condition won't actually work.

This is happening due to the format the options are saved in. The normalizeInputOptions only picks up on the value (which is the "label"). It doesn't know about using the key, if it exists.

@jasonvarga jasonvarga merged commit 78892d2 into 5.x Aug 16, 2024
15 checks passed
@jasonvarga jasonvarga deleted the fix/field-condition-builder-for-expanded-options-config branch August 16, 2024 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants