Skip to content

Commit ecad338

Browse files
committed
# Conflicts: # CHANGELOG.md
2 parents 8581296 + 3dfad2b commit ecad338

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- The control panel is now translated into Greek. ([#18458](https://github.com/craftcms/cms/pull/18458))
66
- The `PDO::MYSQL_ATTR_MULTI_STATEMENTS` attribute is now set to `false` by default for database connections.
77
- Fixed a bug where `searchindex` and `searchindexqueue` rows weren’t being deleted when an element was deleted for a site. ([#18394](https://github.com/craftcms/cms/issues/18394))
8+
- Fixed a bug where multi-select condition rules weren’t applying their “has a value” and “is empty” operators correctly. ([#18470](https://github.com/craftcms/cms/pull/18470))
89
- Fixed an unintended change in behavior where `craft\helpers\App::parseEnv()` was returning `null` instad of an empty string, when an environment variable name was passed in, which was set to an empty string.
910
- Fixed a bug where drafts within “My Drafts” widgets weren’t getting hyperlinked. ([#18456](https://github.com/craftcms/cms/issues/18456))
1011
- Fixed a bug where nested entries were getting assigned new IDs if they were edited multiple times for the same owner element draft. ([#18461](https://github.com/craftcms/cms/issues/18461))

src/base/conditions/BaseMultiSelectConditionRule.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ protected function paramValue(?callable $normalizeValue = null): string|array|nu
181181
*/
182182
protected function matchValue(array|string|null $value): bool
183183
{
184+
if (in_array($this->operator, [self::OPERATOR_EMPTY, self::OPERATOR_NOT_EMPTY])) {
185+
return match ($this->operator) {
186+
self::OPERATOR_EMPTY => empty($value),
187+
self::OPERATOR_NOT_EMPTY => !empty($value),
188+
};
189+
}
190+
184191
if (!$this->_values) {
185192
return true;
186193
}
@@ -194,8 +201,6 @@ protected function matchValue(array|string|null $value): bool
194201
return match ($this->operator) {
195202
self::OPERATOR_IN => !empty(array_intersect($value, $this->_values)),
196203
self::OPERATOR_NOT_IN => empty(array_intersect($value, $this->_values)),
197-
self::OPERATOR_NOT_EMPTY => !empty($value),
198-
self::OPERATOR_EMPTY => empty($value),
199204
default => throw new InvalidConfigException("Invalid operator: $this->operator"),
200205
};
201206
}

0 commit comments

Comments
 (0)