mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-23 14:26:58 +00:00
This commit is contained in:
@@ -108,9 +108,13 @@ class SearchRuleEngine implements RuleEngineInterface
|
|||||||
if (false === $ruleTrigger->active) {
|
if (false === $ruleTrigger->active) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
$contextSearch = $ruleTrigger->trigger_type;
|
||||||
|
if(str_starts_with($ruleTrigger->trigger_type, '-')) {
|
||||||
|
$contextSearch = substr($ruleTrigger->trigger_type, 1);
|
||||||
|
}
|
||||||
|
|
||||||
// if the trigger needs no context, value is different:
|
// if the trigger needs no context, value is different:
|
||||||
$needsContext = (bool)(config(sprintf('search.operators.%s.needs_context', $ruleTrigger->trigger_type)) ?? true);
|
$needsContext = (bool)(config(sprintf('search.operators.%s.needs_context', $contextSearch)) ?? true);
|
||||||
if (false === $needsContext) {
|
if (false === $needsContext) {
|
||||||
app('log')->debug(sprintf('SearchRuleEngine:: add a rule trigger (no context): %s:true', $ruleTrigger->trigger_type));
|
app('log')->debug(sprintf('SearchRuleEngine:: add a rule trigger (no context): %s:true', $ruleTrigger->trigger_type));
|
||||||
$searchArray[$ruleTrigger->trigger_type][] = 'true';
|
$searchArray[$ruleTrigger->trigger_type][] = 'true';
|
||||||
|
Reference in New Issue
Block a user