Skip to content

Commit

Permalink
Merge pull request #14143 from craftcms/bugfix/14128-check-option-val…
Browse files Browse the repository at this point in the history
…ue-for-option-field-condition-rule

check if option has value differently
  • Loading branch information
brandonkelly authored Jan 16, 2024
2 parents c59240b + 7f758f2 commit df3cbb2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- `craft\log\MonologTarget` instances are now created via `Craft::createObject()`. ([#13341](https://github.com/craftcms/cms/issues/13341))
- Fixed a bug where `craft\helpers\Db::prepareValueForDb()` wasn’t converting objects to arrays for JSON columns.
- Fixed a bug where Checkboxes, Multi-select, Dropdown, and Radio Buttons fields weren’t displaying `0` option labels within element indexes. ([#14127](https://github.com/craftcms/cms/issues/14127))
- Fixed a bug where Checkboxes, Multi-select, Dropdown, and Radio Buttons fields weren’t displaying `0` options within element indexes or condition rules. ([#14127](https://github.com/craftcms/cms/issues/14127), [#14143](https://github.com/craftcms/cms/pull/14143))
- Fixed a bug where `craft\db\Migration::renameTable()` was renaming the table for the primary database connection, rather than the migration’s connection. ([#14131](https://github.com/craftcms/cms/issues/14131))
- Fixed a bug where `Craft.FormObserver` wasn’t working reliably for non-`<form>` containers.
- Fixed a bug where Selectize inputs were triggering autosaves, even when the value didn’t change.
Expand Down
2 changes: 1 addition & 1 deletion src/fields/conditions/OptionsFieldConditionRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function options(): array
/** @var BaseOptionsField $field */
$field = $this->field();
return Collection::make($field->options)
->filter(fn(array $option) => !empty($option['value']) && !empty($option['label']))
->filter(fn(array $option) => $option['value'] !== null && $option['value'] !== '' && !empty($option['label']))
->map(fn(array $option) => [
'value' => $option['value'],
'label' => $option['label'],
Expand Down

0 comments on commit df3cbb2

Please sign in to comment.