James Cole
2024-02-03 13:09:44 +01:00
parent a932965908
commit 3543548ba0
2 changed files with 10 additions and 1 deletions

View File

@@ -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);
}
}