diff --git a/application/forms/EventRuleConfigForm.php b/application/forms/EventRuleConfigForm.php index c711e11cb..1f7f8617a 100644 --- a/application/forms/EventRuleConfigForm.php +++ b/application/forms/EventRuleConfigForm.php @@ -139,9 +139,8 @@ protected function assemble(): void ] ); - $this->addElement('hidden', 'zero-condition-escalation'); - $ruleId = $this->config['id']; - + $defaultEscalationPrefix = bin2hex('1'); + $this->addElement('hidden', 'zero-condition-escalation', ['value' => $defaultEscalationPrefix]); $configFilter = new EventRuleConfigFilter($this->searchEditorUrl, $this->config['object_filter']); $this->registerElement($configFilter); @@ -156,7 +155,7 @@ protected function assemble(): void ); $this->registerElement($addEscalationButton); - $prefixesElement = $this->createElement('hidden', 'prefixes-map', ['value' => bin2hex('1')]); + $prefixesElement = $this->createElement('hidden', 'prefixes-map', ['value' => $defaultEscalationPrefix]); $this->addElement($prefixesElement); $this->handleAdd(); @@ -164,12 +163,6 @@ protected function assemble(): void $prefixesMap = explode(',', $prefixesMapString); $escalationCount = count($prefixesMap); $zeroConditionEscalation = $this->getValue('zero-condition-escalation'); - - if ($ruleId === '-1' && $escalationCount === 1 && $zeroConditionEscalation === null) { - $zeroConditionEscalation = bin2hex('1'); - $this->getElement('zero-condition-escalation')->setValue($zeroConditionEscalation); - } - $removePosition = null; $removeEscalationButtons = [];