mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
This commit is contained in:
parent
a932965908
commit
3543548ba0
@ -136,9 +136,13 @@ class SelectController extends Controller
|
||||
}
|
||||
|
||||
foreach ($textTriggers as $textTrigger) {
|
||||
$needsContext = config(sprintf('search.operators.%s.needs_context', $textTrigger['type'])) ?? true;
|
||||
$trigger = new RuleTrigger();
|
||||
$trigger->trigger_type = $textTrigger['type'];
|
||||
$trigger->trigger_value = $textTrigger['value'];
|
||||
if(false === $needsContext) {
|
||||
$trigger->trigger_value = 'true';
|
||||
}
|
||||
$trigger->stop_processing = $textTrigger['stop_processing'];
|
||||
if ($textTrigger['prohibited']) {
|
||||
$trigger->trigger_type = sprintf('-%s', $textTrigger['type']);
|
||||
|
@ -141,11 +141,16 @@ class RuleRepository implements RuleRepositoryInterface
|
||||
if ('user_action' === $trigger->trigger_type) {
|
||||
continue;
|
||||
}
|
||||
$needsContext = config(sprintf('search.operators.%s.needs_context', $trigger->trigger_type)) ?? true;
|
||||
$triggerType = $trigger->trigger_type;
|
||||
if(str_starts_with($trigger->trigger_type, '-')) {
|
||||
$triggerType = substr($trigger->trigger_type, 1);
|
||||
}
|
||||
$needsContext = config(sprintf('search.operators.%s.needs_context', $triggerType)) ?? true;
|
||||
if (false === $needsContext) {
|
||||
$params[] = sprintf('%s:true', OperatorQuerySearch::getRootOperator($trigger->trigger_type));
|
||||
}
|
||||
if (true === $needsContext) {
|
||||
var_dump('x');
|
||||
$params[] = sprintf('%s:"%s"', OperatorQuerySearch::getRootOperator($trigger->trigger_type), $trigger->trigger_value);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user