diff --git a/lib/plugins/plugin.inc.php b/lib/plugins/plugin.inc.php index 132c1ca..295bd09 100644 --- a/lib/plugins/plugin.inc.php +++ b/lib/plugins/plugin.inc.php @@ -5,7 +5,7 @@ * KnowledgeTree Community Edition * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. - * + * * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the @@ -751,6 +751,11 @@ class KTPlugin { )); } + }else{ + // Update the plugin path, in case it has moved + $oEntity->updateFromArray(array( + 'path' => $this->stripKtDir($this->sFilename) + )); } /* ** Quick fix for optimisation. Reread must run plugin setup. ** */ $this->setup(); diff --git a/lib/plugins/pluginutil.inc.php b/lib/plugins/pluginutil.inc.php index f0460fb..c0e3b3a 100644 --- a/lib/plugins/pluginutil.inc.php +++ b/lib/plugins/pluginutil.inc.php @@ -5,7 +5,7 @@ * KnowledgeTree Community Edition * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. - * + * * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the @@ -598,10 +598,18 @@ class KTPluginUtil { if (!KTUtil::isAbsolutePath($sPath)) { $sPath = sprintf("%s/%s", KT_DIR, $sPath); } + // Check that the file exists at the given path + // If it doesn't set it as unavailable and disabled + // else set it as available and enabled. + // We'll document this in case they've specifically disabled certain plugins if (!file_exists($sPath)) { $oPluginEntity->setUnavailable(true); $oPluginEntity->setDisabled(true); $res = $oPluginEntity->update(); + }elseif ($oPluginEntity->getUnavailable()){ + $oPluginEntity->setUnavailable(false); + $oPluginEntity->setDisabled(false); + $res = $oPluginEntity->update(); } } KTPluginEntity::clearAllCaches(); diff --git a/search2/documentProcessor/documentProcessor.inc.php b/search2/documentProcessor/documentProcessor.inc.php index 9967e57..2532a63 100644 --- a/search2/documentProcessor/documentProcessor.inc.php +++ b/search2/documentProcessor/documentProcessor.inc.php @@ -246,6 +246,11 @@ class DocumentProcessor global $default; $default->log->debug('documentProcessor: starting processing'); + if($this->processors === false){ + $default->log->info('documentProcessor: stopping - no processors enabled'); + return ; + } + // Get processing queue // Use the same batch size as the indexer (for now) // If the batch size is huge then reset it to a smaller number @@ -286,9 +291,8 @@ class DocumentProcessor // Process document $processor->setDocument($document); $processor->processDocument(); - - Indexer::unqueueDocFromProcessing($docId, "Document processed", 'debug'); } + Indexer::unqueueDocFromProcessing($docId, "Document processed", 'debug'); } }