mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 20:16:22 +00:00
Fix search for #3850
This commit is contained in:
@@ -547,7 +547,14 @@ class RuleRepository implements RuleRepositoryInterface
|
|||||||
$params = [];
|
$params = [];
|
||||||
/** @var RuleTrigger $trigger */
|
/** @var RuleTrigger $trigger */
|
||||||
foreach ($rule->ruleTriggers as $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);
|
$params[] = sprintf('%s:"%s"', OperatorQuerySearch::getRootOperator($trigger->trigger_type), $trigger->trigger_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user