From b53547c1e27c6d2667089d026d46897fa83ddc87 Mon Sep 17 00:00:00 2001 From: alfredo-dotcms <37185433+alfredo-dotcms@users.noreply.github.com> Date: Wed, 30 Jun 2021 15:39:59 -0600 Subject: [PATCH] dotCMS/core#20153 fix rules-deactivating-on-valid-actions (#1689) --- libs/dot-rules/src/lib/rule-engine.container.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/dot-rules/src/lib/rule-engine.container.ts b/libs/dot-rules/src/lib/rule-engine.container.ts index fd64ef9990..cf29f9caa5 100644 --- a/libs/dot-rules/src/lib/rule-engine.container.ts +++ b/libs/dot-rules/src/lib/rule-engine.container.ts @@ -606,8 +606,8 @@ export class RuleEngineContainer implements OnDestroy { } patchAction(rule: RuleModel, ruleAction: ActionModel): void { - this.ruleUpdating(rule); if (ruleAction.isValid()) { + this.ruleUpdating(rule, false); if (!ruleAction.isPersisted()) { this._ruleActionService.createRuleAction(rule.key, ruleAction).subscribe( (_) => { @@ -630,6 +630,7 @@ export class RuleEngineContainer implements OnDestroy { ); } } else { + this.ruleUpdating(rule); this.ruleUpdated(rule, { invalid: 'Cannot save, action is not valid.' });