From 35859bb8c4955383bc232bf789a575b53450668f Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Mon, 6 May 2019 10:38:49 +0300 Subject: [PATCH 1/3] CLI: Disabling TNTSearch index update --- tntsearch.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tntsearch.php b/tntsearch.php index 1394c05..4b16191 100644 --- a/tntsearch.php +++ b/tntsearch.php @@ -315,6 +315,10 @@ public function onAdminTaskExecute(Event $e) */ public function onObjectSave($event) { + if (defined('CLI_DISABLE_TNTSEARCH')) { + return true; + } + $obj = $event['object'] ?: $event['page']; if ($obj) { @@ -332,6 +336,9 @@ public function onObjectSave($event) */ public function onObjectDelete($event) { + if (defined('CLI_DISABLE_TNTSEARCH')) { + return true; + } $obj = $event['object'] ?: $event['page']; if ($obj) { From 3105b2078d011d5b910a98612d27dae300dfc295 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 20 Jan 2020 17:06:36 -0700 Subject: [PATCH 2/3] Fixed an issue indexing via Admin with Grav 1.7 --- CHANGELOG.md | 8 +++++++- tntsearch.php | 19 +++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 068e3e7..c384cee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ +# v3.0.1 +## mm/dd/2020 + +1. [](#bugfix) + * Fixed an issue indexing via Admin with Grav 1.7 + # v3.0.0 -## 04/14/2018 +## 04/14/2019 1. [](#new) * Added new Grav Scheduler integration diff --git a/tntsearch.php b/tntsearch.php index 4b16191..9f2955e 100644 --- a/tntsearch.php +++ b/tntsearch.php @@ -4,6 +4,7 @@ use Composer\Autoload\ClassLoader; use Grav\Common\Grav; use Grav\Common\Page\Page; +use Grav\Common\Page\Pages; use Grav\Common\Plugin; use Grav\Common\Scheduler\Scheduler; use Grav\Plugin\TNTSearch\GravTNTSearch; @@ -440,6 +441,9 @@ public static function indexJob() $language = $grav['language']; + /** @var Pages $pages */ + $pages = $grav['pages']; + ob_start(); if ($language->enabled()) { @@ -448,12 +452,23 @@ public static function indexJob() $language->setActive($lang); echo("\nLanguage: $lang\n"); - $grav['pages']->init(); + + if (method_exists($pages, 'enablePages')) { + $pages->enablePages(); + } else { + $pages->init(); + } + $gtnt = static::getSearchObjectType(); $gtnt->createIndex(); } } else { - $grav['pages']->init(); + if (method_exists($pages, 'enablePages')) { + $pages->enablePages(); + } else { + $pages->init(); + } + $gtnt = static::getSearchObjectType(); $gtnt->createIndex(); } From 3c5b5eaf33826c73693be59d82eb9ebe4a3ac15f Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 3 Feb 2020 11:07:02 -0700 Subject: [PATCH 3/3] prepare for release --- CHANGELOG.md | 2 +- blueprints.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c384cee..0bcedab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # v3.0.1 -## mm/dd/2020 +## 02/03/2020 1. [](#bugfix) * Fixed an issue indexing via Admin with Grav 1.7 diff --git a/blueprints.yaml b/blueprints.yaml index 3c91a85..0ce2d5d 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: TNT Search -version: 3.0.0 +version: 3.0.1 testing: false description: Powerful indexed-based full text search engine powered by TNTSearch icon: binoculars