From f92b66890290b2bc2df555df0235247820ea3d3d Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Fri, 7 Jun 2024 15:47:32 +0200 Subject: [PATCH] EventRuleConfigForm::getChanges: Take escalation deletion into account --- application/forms/EventRuleConfigForm.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/application/forms/EventRuleConfigForm.php b/application/forms/EventRuleConfigForm.php index f39be1225..c659d4b9d 100644 --- a/application/forms/EventRuleConfigForm.php +++ b/application/forms/EventRuleConfigForm.php @@ -656,6 +656,15 @@ public function getChanges(): array $values = $this->getValues(); $dbValuesToCompare = array_intersect_key($this->config, $values); + if (count($values, COUNT_RECURSIVE) < count($dbValuesToCompare, COUNT_RECURSIVE)) { + if ($values['object_filter'] === $dbValuesToCompare['object_filter']) { + unset($values['object_filter']); + } + + // escalation has been removed + return $values; + } + $checker = static function ($a, $b) use (&$checker) { if (! is_array($a) || ! is_array($b)) { return $a <=> $b;