mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 19:53:44 +00:00
Fix search for #3850
This commit is contained in:
@@ -547,7 +547,14 @@ class RuleRepository implements RuleRepositoryInterface
|
||||
$params = [];
|
||||
/** @var RuleTrigger $trigger */
|
||||
foreach ($rule->ruleTriggers as $trigger) {
|
||||
if ('user_action' !== $trigger->trigger_type) {
|
||||
if ('user_action' === $trigger->trigger_type) {
|
||||
continue;
|
||||
}
|
||||
$needsContext = config(sprintf('firefly.search.operators.%s.needs_context', $trigger->trigger_type)) ?? true;
|
||||
if (false === $needsContext) {
|
||||
$params[] = sprintf('%s:true', OperatorQuerySearch::getRootOperator($trigger->trigger_type));
|
||||
}
|
||||
if (true === $needsContext) {
|
||||
$params[] = sprintf('%s:"%s"', OperatorQuerySearch::getRootOperator($trigger->trigger_type), $trigger->trigger_value);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user