From d24b072c3109ac490e5c0ee36a248d0859bd8e28 Mon Sep 17 00:00:00 2001 From: raviks789 Date: Fri, 7 Jun 2024 17:08:58 +0200 Subject: [PATCH] EventRuleConfigForm: Consider escalation deletion while checking for changes --- application/forms/EventRuleConfigForm.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/application/forms/EventRuleConfigForm.php b/application/forms/EventRuleConfigForm.php index ee4680e15..8553f719e 100644 --- a/application/forms/EventRuleConfigForm.php +++ b/application/forms/EventRuleConfigForm.php @@ -657,6 +657,15 @@ public function getChanges(): array $values = $this->getValues(); $dbValuesToCompare = array_intersect_key($this->config, $values); + if (count($values, COUNT_RECURSIVE) < count($dbValuesToCompare, COUNT_RECURSIVE)) { + // fewer values in the form than in the db, escalation(s) has been removed + if ($values['object_filter'] === $dbValuesToCompare['object_filter']) { + unset($values['object_filter']); + } + + return $values; + } + $checker = static function ($a, $b) use (&$checker) { if (! is_array($a) || ! is_array($b)) { return $a <=> $b;