Skip to content

Commit b096fb7

Browse files
EscalationCondition.php: Set default operator value
For the `incident_age` column, the `operator` select is disabled and only offers a single option (`>`). Disabled HTML selects don't submit a value, so the operator was previously missing from the submitted data and form could not be submitted. Defaulting the element's value to the first available option ensures it's always set, even while disabled.
1 parent efb25c6 commit b096fb7

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

application/forms/EventRuleConfigElements/EscalationCondition.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ protected function assemble(): void
135135
$this->addElement('select', 'operator', [
136136
'required' => true,
137137
'options' => $operators,
138+
'value' => array_key_first($operators),
138139
'disabled' => $selectedColumn === 'incident_age'
139140
]);
140141

0 commit comments

Comments
 (0)