From a5260079576172a47b463207895ede43ab54ba9c Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 10 Sep 2020 14:48:02 +0200 Subject: [PATCH 1/5] Add URL compatibility --- app/Support/Search/OperatorQuerySearch.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php index 017d4c914a..b9b3565c70 100644 --- a/app/Support/Search/OperatorQuerySearch.php +++ b/app/Support/Search/OperatorQuerySearch.php @@ -41,6 +41,7 @@ use Gdbots\QueryParser\Node\Field; use Gdbots\QueryParser\Node\Node; use Gdbots\QueryParser\Node\Numbr; use Gdbots\QueryParser\Node\Phrase; +use Gdbots\QueryParser\Node\Url; use Gdbots\QueryParser\Node\Word; use Gdbots\QueryParser\ParsedQuery; use Gdbots\QueryParser\QueryParser; @@ -222,6 +223,7 @@ class OperatorQuerySearch implements SearchInterface case Word::class: case Phrase::class: case Numbr::class: + case Url::class: Log::debug(sprintf('Now handle %s', $class)); $this->words[] = (string) $searchNode->getValue(); break; From bded065d42be4432d01f00a7e7fc436929d3de70 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 10 Sep 2020 14:50:22 +0200 Subject: [PATCH 2/5] Support date --- app/Support/Search/OperatorQuerySearch.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php index b9b3565c70..a07ff11346 100644 --- a/app/Support/Search/OperatorQuerySearch.php +++ b/app/Support/Search/OperatorQuerySearch.php @@ -37,6 +37,7 @@ use FireflyIII\Repositories\Tag\TagRepositoryInterface; use FireflyIII\Repositories\TransactionType\TransactionTypeRepositoryInterface; use FireflyIII\Support\ParseDateString; use FireflyIII\User; +use Gdbots\QueryParser\Node\Date; use Gdbots\QueryParser\Node\Field; use Gdbots\QueryParser\Node\Node; use Gdbots\QueryParser\Node\Numbr; @@ -224,6 +225,7 @@ class OperatorQuerySearch implements SearchInterface case Phrase::class: case Numbr::class: case Url::class: + case Date::class: Log::debug(sprintf('Now handle %s', $class)); $this->words[] = (string) $searchNode->getValue(); break; From 600e98cf47254d4d879968803aeff2ccf283c575 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 10 Sep 2020 14:50:49 +0200 Subject: [PATCH 3/5] Add hashtag --- app/Support/Search/OperatorQuerySearch.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php index a07ff11346..1d14e55fac 100644 --- a/app/Support/Search/OperatorQuerySearch.php +++ b/app/Support/Search/OperatorQuerySearch.php @@ -39,6 +39,7 @@ use FireflyIII\Support\ParseDateString; use FireflyIII\User; use Gdbots\QueryParser\Node\Date; use Gdbots\QueryParser\Node\Field; +use Gdbots\QueryParser\Node\Hashtag; use Gdbots\QueryParser\Node\Node; use Gdbots\QueryParser\Node\Numbr; use Gdbots\QueryParser\Node\Phrase; @@ -226,6 +227,7 @@ class OperatorQuerySearch implements SearchInterface case Numbr::class: case Url::class: case Date::class: + case Hashtag::class: Log::debug(sprintf('Now handle %s', $class)); $this->words[] = (string) $searchNode->getValue(); break; From 562be457eca1a3bd843f1d1b2376d3c3e50c2ee9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 10 Sep 2020 14:53:35 +0200 Subject: [PATCH 4/5] Add more types. --- app/Support/Search/OperatorQuerySearch.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php index 1d14e55fac..d5944d2fa8 100644 --- a/app/Support/Search/OperatorQuerySearch.php +++ b/app/Support/Search/OperatorQuerySearch.php @@ -38,8 +38,11 @@ use FireflyIII\Repositories\TransactionType\TransactionTypeRepositoryInterface; use FireflyIII\Support\ParseDateString; use FireflyIII\User; use Gdbots\QueryParser\Node\Date; +use Gdbots\QueryParser\Node\Emoji; +use Gdbots\QueryParser\Node\Emoticon; use Gdbots\QueryParser\Node\Field; use Gdbots\QueryParser\Node\Hashtag; +use Gdbots\QueryParser\Node\Mention; use Gdbots\QueryParser\Node\Node; use Gdbots\QueryParser\Node\Numbr; use Gdbots\QueryParser\Node\Phrase; @@ -228,6 +231,9 @@ class OperatorQuerySearch implements SearchInterface case Url::class: case Date::class: case Hashtag::class: + case Emoticon::class: + case Emoji::class: + case Mention::class: Log::debug(sprintf('Now handle %s', $class)); $this->words[] = (string) $searchNode->getValue(); break; From 402351a6b72f09d352810b3fed3a3d7049730085 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 10 Sep 2020 19:16:03 +0200 Subject: [PATCH 5/5] Fix #3789 --- .../Commands/UpgradeFireflyInstructions.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/app/Console/Commands/UpgradeFireflyInstructions.php b/app/Console/Commands/UpgradeFireflyInstructions.php index 67cd1db0f0..e2fb1027a4 100644 --- a/app/Console/Commands/UpgradeFireflyInstructions.php +++ b/app/Console/Commands/UpgradeFireflyInstructions.php @@ -26,6 +26,7 @@ namespace FireflyIII\Console\Commands; use FireflyIII\Support\System\GeneratesInstallationId; use FireflyIII\User; use Illuminate\Console\Command; +use Illuminate\Database\QueryException; /** * Class UpgradeFireflyInstructions. @@ -56,10 +57,10 @@ class UpgradeFireflyInstructions extends Command public function handle(): int { $this->generateInstallationId(); - if ('update' === (string) $this->argument('task')) { + if ('update' === (string)$this->argument('task')) { $this->updateInstructions(); } - if ('install' === (string) $this->argument('task')) { + if ('install' === (string)$this->argument('task')) { $this->installInstructions(); } @@ -70,7 +71,11 @@ class UpgradeFireflyInstructions extends Command app('telemetry')->feature('system.database.driver', env('DB_CONNECTION', '(unknown)')); app('telemetry')->feature('system.os.is_docker', $isDocker); app('telemetry')->feature('system.command.executed', $this->signature); - app('telemetry')->feature('system.users.count', (string) User::count()); + try { + app('telemetry')->feature('system.users.count', (string)User::count()); + } catch (QueryException $e) { + // ignore error. + } return 0; } @@ -108,8 +113,8 @@ class UpgradeFireflyInstructions extends Command { /** @var string $version */ $version = config('firefly.version'); - $config = config('upgrade.text.install'); - $text = ''; + $config = config('upgrade.text.install'); + $text = ''; foreach (array_keys($config) as $compare) { // if string starts with: if (0 === strpos($version, $compare)) { @@ -156,8 +161,8 @@ class UpgradeFireflyInstructions extends Command { /** @var string $version */ $version = config('firefly.version'); - $config = config('upgrade.text.upgrade'); - $text = ''; + $config = config('upgrade.text.upgrade'); + $text = ''; foreach (array_keys($config) as $compare) { // if string starts with: if (0 === strpos($version, $compare)) {