@@ -139,9 +139,15 @@ protected function assemble(): void
139
139
]
140
140
);
141
141
142
- $ this -> addElement ( ' hidden ' , ' zero-condition-escalation ' );
142
+ $ defaultEscalationPrefix = bin2hex ( ' 1 ' );
143
143
$ ruleId = $ this ->config ['id ' ];
144
144
145
+ $ this ->addElement (
146
+ 'hidden ' ,
147
+ 'zero-condition-escalation ' ,
148
+ ['value ' => $ ruleId === '-1 ' ? $ defaultEscalationPrefix : null ]
149
+ );
150
+
145
151
$ configFilter = new EventRuleConfigFilter ($ this ->searchEditorUrl , $ this ->config ['object_filter ' ]);
146
152
$ this ->registerElement ($ configFilter );
147
153
@@ -156,20 +162,14 @@ protected function assemble(): void
156
162
);
157
163
158
164
$ this ->registerElement ($ addEscalationButton );
159
- $ prefixesElement = $ this ->createElement ('hidden ' , 'prefixes-map ' , ['value ' => bin2hex ( ' 1 ' ) ]);
165
+ $ prefixesElement = $ this ->createElement ('hidden ' , 'prefixes-map ' , ['value ' => $ defaultEscalationPrefix ]);
160
166
$ this ->addElement ($ prefixesElement );
161
167
$ this ->handleAdd ();
162
168
163
169
$ prefixesMapString = $ prefixesElement ->getValue ();
164
170
$ prefixesMap = explode (', ' , $ prefixesMapString );
165
171
$ escalationCount = count ($ prefixesMap );
166
172
$ zeroConditionEscalation = $ this ->getValue ('zero-condition-escalation ' );
167
-
168
- if ($ ruleId === '-1 ' && $ escalationCount === 1 && $ zeroConditionEscalation === null ) {
169
- $ zeroConditionEscalation = bin2hex ('1 ' );
170
- $ this ->getElement ('zero-condition-escalation ' )->setValue ($ zeroConditionEscalation );
171
- }
172
-
173
173
$ removePosition = null ;
174
174
$ removeEscalationButtons = [];
175
175
0 commit comments