mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-01 11:15:55 +00:00
Fix https://github.com/firefly-iii/firefly-iii/issues/8291 AND fix issue with non-strict rule triggers AND fix behaviour of actions
This commit is contained in:
@@ -325,6 +325,12 @@ class SearchRuleEngine implements RuleEngineInterface
|
||||
$total = $total->merge($collection);
|
||||
app('log')->debug(sprintf('Total collection is now %d transactions', $total->count()));
|
||||
++$count;
|
||||
// if trigger says stop processing, do so.
|
||||
if($ruleTrigger->stop_processing && $collection->count() > 0) {
|
||||
app('log')->debug('The trigger says to stop processing, so stop processing other triggers.');
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
app('log')->debug(sprintf('Total collection is now %d transactions', $total->count()));
|
||||
app('log')->debug(sprintf('Done running %d trigger(s)', $count));
|
||||
@@ -465,11 +471,14 @@ class SearchRuleEngine implements RuleEngineInterface
|
||||
}
|
||||
|
||||
// pick up from the action if it actually acted or not:
|
||||
if ($ruleAction->stop_processing) {
|
||||
app('log')->debug(sprintf('Rule action "%s" asks to break, so break!', $ruleAction->action_type));
|
||||
if ($ruleAction->stop_processing && true === $result) {
|
||||
app('log')->debug(sprintf('Rule action "%s" reports changes AND asks to break, so break!', $ruleAction->action_type));
|
||||
|
||||
return true;
|
||||
}
|
||||
if ($ruleAction->stop_processing && false === $result) {
|
||||
app('log')->debug(sprintf('Rule action "%s" reports NO changes AND asks to break, but we wont break!', $ruleAction->action_type));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user