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

[4.x]: Error with Conditions on Dropdown fields with Optgroup #14224

Closed
tommysvr opened this issue Jan 27, 2024 · 2 comments
Closed

[4.x]: Error with Conditions on Dropdown fields with Optgroup #14224

tommysvr opened this issue Jan 27, 2024 · 2 comments
Assignees

Comments

@tommysvr
Copy link

tommysvr commented Jan 27, 2024

What happened?

Description

When editing an Entry Type with an existing condition on a Dropdown field with an Optgroup, I'm getting an Undefined array key "value" error.

[web.ERROR] [yii\base\ErrorException:2] yii\base\ErrorException: Undefined array key "value" in /var/www/html/vendor/craftcms/cms/src/fields/conditions/OptionsFieldConditionRule.php:28

Trying to create a new condition based on a Dropdown field with an Optgroup doesn't error, but you're not able to add any rules.

It looks to be related to this change: 6ceb924

Steps to reproduce

  1. Create a Dropdown field with an Optgroup
  2. Add that to an Entry Type
  3. Add a Condition to another field based on the Dropdown
  4. Unable to add rules

Expected behavior

Able to add rules like this:

screenshot_2024_01_27 _13 29

Actual behavior

Unable add any rules:

screenshot_2024_01_27 _13 33

Craft CMS version

Tested on 4.6.1 and 4.7.0

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

No response

@tommysvr tommysvr changed the title [4.x]: Errors with Conditions on Dropdown fields with Optgroup [4.x]: Error with Conditions on Dropdown fields with Optgroup Jan 27, 2024
@i-just
Copy link
Contributor

i-just commented Jan 29, 2024

Thanks for all the info, Tommy! I raised a PR for this.

@brandonkelly
Copy link
Member

Fixed in 4.7.1!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants