mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-20 11:19:16 +00:00
Fix missing search node type.
This commit is contained in:
@@ -39,6 +39,7 @@ use FireflyIII\Support\ParseDateString;
|
|||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Gdbots\QueryParser\Node\Field;
|
use Gdbots\QueryParser\Node\Field;
|
||||||
use Gdbots\QueryParser\Node\Node;
|
use Gdbots\QueryParser\Node\Node;
|
||||||
|
use Gdbots\QueryParser\Node\Numbr;
|
||||||
use Gdbots\QueryParser\Node\Phrase;
|
use Gdbots\QueryParser\Node\Phrase;
|
||||||
use Gdbots\QueryParser\Node\Word;
|
use Gdbots\QueryParser\Node\Word;
|
||||||
use Gdbots\QueryParser\ParsedQuery;
|
use Gdbots\QueryParser\ParsedQuery;
|
||||||
@@ -220,8 +221,9 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
throw new FireflyException(sprintf('Firefly III search cant handle "%s"-nodes', $class));
|
throw new FireflyException(sprintf('Firefly III search cant handle "%s"-nodes', $class));
|
||||||
case Word::class:
|
case Word::class:
|
||||||
case Phrase::class:
|
case Phrase::class:
|
||||||
|
case Numbr::class:
|
||||||
Log::debug(sprintf('Now handle %s', $class));
|
Log::debug(sprintf('Now handle %s', $class));
|
||||||
$this->words[] = $searchNode->getValue();
|
$this->words[] = (string) $searchNode->getValue();
|
||||||
break;
|
break;
|
||||||
case Field::class:
|
case Field::class:
|
||||||
Log::debug(sprintf('Now handle %s', $class));
|
Log::debug(sprintf('Now handle %s', $class));
|
||||||
@@ -259,7 +261,7 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
$operator = self::getRootOperator($operator);
|
$operator = self::getRootOperator($operator);
|
||||||
|
|
||||||
app('telemetry')->feature('search.operators.uses_operator', $operator);
|
app('telemetry')->feature('search.operators.uses_operator', $operator);
|
||||||
|
|
||||||
switch ($operator) {
|
switch ($operator) {
|
||||||
default:
|
default:
|
||||||
Log::error(sprintf('No such operator: %s', $operator));
|
Log::error(sprintf('No such operator: %s', $operator));
|
||||||
@@ -679,10 +681,10 @@ class OperatorQuerySearch implements SearchInterface
|
|||||||
*/
|
*/
|
||||||
private function findCurrency(string $value): ?TransactionCurrency
|
private function findCurrency(string $value): ?TransactionCurrency
|
||||||
{
|
{
|
||||||
if(str_contains($value,'(') && str_contains($value,')')) {
|
if (str_contains($value, '(') && str_contains($value, ')')) {
|
||||||
// bad method to split and get the currency code:
|
// bad method to split and get the currency code:
|
||||||
$parts = explode(' ', $value);
|
$parts = explode(' ', $value);
|
||||||
$value = trim($parts[count($parts) -1], "() \t\n\r\0\x0B");
|
$value = trim($parts[count($parts) - 1], "() \t\n\r\0\x0B");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user