From a7c2720f52603bdf2c6ca8741e7ec7956499b708 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Wed, 9 Oct 2024 01:26:07 -0700 Subject: [PATCH] Money, too --- src/fields/conditions/MoneyFieldConditionRule.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/fields/conditions/MoneyFieldConditionRule.php b/src/fields/conditions/MoneyFieldConditionRule.php index 356789d21c2..4f9d360ddaa 100644 --- a/src/fields/conditions/MoneyFieldConditionRule.php +++ b/src/fields/conditions/MoneyFieldConditionRule.php @@ -103,10 +103,8 @@ protected function inputHtml(): string */ protected function inputOptions(): array { + /** @var Money $field */ $field = $this->field(); - if (!$field instanceof Money) { - throw new InvalidConfigException(); - } $defaultValue = null; if ($field->defaultValue !== null) { $defaultValue = MoneyHelper::toNumber(new MoneyLibrary($field->defaultValue, new Currency($field->currency))); @@ -136,6 +134,10 @@ protected function inputOptions(): array */ protected function elementQueryParam(): ?string { + if (!$this->field() instanceof Money) { + return null; + } + return $this->paramValue(); } @@ -145,8 +147,7 @@ protected function elementQueryParam(): ?string protected function matchFieldValue($value): bool { if (!$this->field() instanceof Money) { - // No longer a Money field - return false; + return true; } /** @var int|float|null $value */