Skip to content

Commit

Permalink
EventRuleConfigForm: Consider escalation deletion while checking for …
Browse files Browse the repository at this point in the history
…changes
  • Loading branch information
raviks789 committed Jun 20, 2024
1 parent 48ed2b7 commit d24b072
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions application/forms/EventRuleConfigForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d24b072

Please sign in to comment.