@@ -50,16 +50,20 @@ class EventRuleConfigForm extends Form
50
50
/** @var bool Whether the config has an escalation with no condition */
51
51
protected $ hasZeroConditionEscalation = false ;
52
52
53
+ /** @var ?string */
54
+ protected $ objectFilter ;
55
+
53
56
/**
54
57
* Create a new EventRuleConfigForm
55
58
*
56
59
* @param array<string, mixed> $config
57
60
* @param Url $searchEditorUrl
58
61
*/
59
- public function __construct (array $ config , Url $ searchEditorUrl )
62
+ public function __construct (array $ config , Url $ searchEditorUrl, ? string $ objectFilter )
60
63
{
61
64
$ this ->config = $ config ;
62
65
$ this ->searchEditorUrl = $ searchEditorUrl ;
66
+ $ this ->objectFilter = $ objectFilter ;
63
67
}
64
68
65
69
public function hasBeenSubmitted (): bool
@@ -179,7 +183,7 @@ protected function assemble(): void
179
183
$ this ->getElement ('zero-condition-escalation ' )->setValue ($ defaultEscalationPrefix );
180
184
}
181
185
182
- $ configFilter = new EventRuleConfigFilter ($ this ->searchEditorUrl , $ this ->config [ ' object_filter ' ] );
186
+ $ configFilter = new EventRuleConfigFilter ($ this ->searchEditorUrl , $ this ->objectFilter );
183
187
$ this ->registerElement ($ configFilter );
184
188
185
189
$ addEscalationButton = new SubmitButtonElement (
@@ -463,7 +467,8 @@ public function updateRule(int $id, array $config): int
463
467
{
464
468
$ db = Database::get ();
465
469
$ db ->beginTransaction ();
466
- $ db ->update ('rule ' , ['object_filter ' => $ config ['object_filter ' ] ?? null ], ['id = ? ' => $ id ]);
470
+
471
+ $ db ->update ('rule ' , ['object_filter ' => $ this ->objectFilter ], ['id = ? ' => $ id ]);
467
472
468
473
if (! isset ($ config ['rule_escalation ' ])) {
469
474
$ db ->commitTransaction ();
0 commit comments