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