mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 01:41:14 -06:00
Fix #3844
This commit is contained in:
parent
620b69f234
commit
f093dbb30b
@ -232,8 +232,16 @@ class SearchRuleEngine implements RuleEngineInterface
|
||||
$searchArray = [];
|
||||
/** @var RuleTrigger $ruleTrigger */
|
||||
foreach ($rule->ruleTriggers as $ruleTrigger) {
|
||||
Log::debug(sprintf('SearchRuleEngine:: add a rule trigger: %s:"%s"', $ruleTrigger->trigger_type, $ruleTrigger->trigger_value));
|
||||
$searchArray[$ruleTrigger->trigger_type] = sprintf('"%s"', $ruleTrigger->trigger_value);
|
||||
// if needs no context, value is different:
|
||||
$needsContext = config(sprintf('firefly.search.operators.%s.needs_context', $ruleTrigger->trigger_type)) ?? true;
|
||||
if(false === $needsContext) {
|
||||
Log::debug(sprintf('SearchRuleEngine:: add a rule trigger: %s:true', $ruleTrigger->trigger_type));
|
||||
$searchArray[$ruleTrigger->trigger_type] = 'true';
|
||||
}
|
||||
if(true === $needsContext) {
|
||||
Log::debug(sprintf('SearchRuleEngine:: add a rule trigger: %s:"%s"', $ruleTrigger->trigger_type, $ruleTrigger->trigger_value));
|
||||
$searchArray[$ruleTrigger->trigger_type] = sprintf('"%s"', $ruleTrigger->trigger_value);
|
||||
}
|
||||
}
|
||||
|
||||
// add local operators:
|
||||
@ -279,8 +287,15 @@ class SearchRuleEngine implements RuleEngineInterface
|
||||
continue;
|
||||
}
|
||||
$searchArray = [];
|
||||
Log::debug(sprintf('SearchRuleEngine:: non strict, will search for: %s:"%s"', $ruleTrigger->trigger_type, $ruleTrigger->trigger_value));
|
||||
$searchArray[$ruleTrigger->trigger_type] = sprintf('"%s"', $ruleTrigger->trigger_value);
|
||||
$needsContext = config(sprintf('firefly.search.operators.%s.needs_context', $ruleTrigger->trigger_type)) ?? true;
|
||||
if(false === $needsContext) {
|
||||
Log::debug(sprintf('SearchRuleEngine:: non strict, will search for: %s:true', $ruleTrigger->trigger_type));
|
||||
$searchArray[$ruleTrigger->trigger_type] = 'true';
|
||||
}
|
||||
if(true === $needsContext) {
|
||||
Log::debug(sprintf('SearchRuleEngine:: non strict, will search for: %s:"%s"', $ruleTrigger->trigger_type, $ruleTrigger->trigger_value));
|
||||
$searchArray[$ruleTrigger->trigger_type] = sprintf('"%s"', $ruleTrigger->trigger_value);
|
||||
}
|
||||
|
||||
// then, add local operators as well:
|
||||
foreach ($this->operators as $operator) {
|
||||
|
Loading…
Reference in New Issue
Block a user