Commit f3234813d9e6aeab8e84e1c0396e316e2eb553f9
Merge branch 'edge' of git@github.com:ktgit/knowledgetree into edge
Showing
3 changed files
with
21 additions
and
4 deletions
lib/plugins/plugin.inc.php
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | * KnowledgeTree Community Edition |
| 6 | 6 | * Document Management Made Simple |
| 7 | 7 | * Copyright (C) 2008, 2009 KnowledgeTree Inc. |
| 8 | - * | |
| 8 | + * | |
| 9 | 9 | * |
| 10 | 10 | * This program is free software; you can redistribute it and/or modify it under |
| 11 | 11 | * the terms of the GNU General Public License version 3 as published by the |
| ... | ... | @@ -751,6 +751,11 @@ class KTPlugin { |
| 751 | 751 | )); |
| 752 | 752 | |
| 753 | 753 | } |
| 754 | + }else{ | |
| 755 | + // Update the plugin path, in case it has moved | |
| 756 | + $oEntity->updateFromArray(array( | |
| 757 | + 'path' => $this->stripKtDir($this->sFilename) | |
| 758 | + )); | |
| 754 | 759 | } |
| 755 | 760 | /* ** Quick fix for optimisation. Reread must run plugin setup. ** */ |
| 756 | 761 | $this->setup(); | ... | ... |
lib/plugins/pluginutil.inc.php
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | * KnowledgeTree Community Edition |
| 6 | 6 | * Document Management Made Simple |
| 7 | 7 | * Copyright (C) 2008, 2009 KnowledgeTree Inc. |
| 8 | - * | |
| 8 | + * | |
| 9 | 9 | * |
| 10 | 10 | * This program is free software; you can redistribute it and/or modify it under |
| 11 | 11 | * the terms of the GNU General Public License version 3 as published by the |
| ... | ... | @@ -598,10 +598,18 @@ class KTPluginUtil { |
| 598 | 598 | if (!KTUtil::isAbsolutePath($sPath)) { |
| 599 | 599 | $sPath = sprintf("%s/%s", KT_DIR, $sPath); |
| 600 | 600 | } |
| 601 | + // Check that the file exists at the given path | |
| 602 | + // If it doesn't set it as unavailable and disabled | |
| 603 | + // else set it as available and enabled. | |
| 604 | + // We'll document this in case they've specifically disabled certain plugins | |
| 601 | 605 | if (!file_exists($sPath)) { |
| 602 | 606 | $oPluginEntity->setUnavailable(true); |
| 603 | 607 | $oPluginEntity->setDisabled(true); |
| 604 | 608 | $res = $oPluginEntity->update(); |
| 609 | + }elseif ($oPluginEntity->getUnavailable()){ | |
| 610 | + $oPluginEntity->setUnavailable(false); | |
| 611 | + $oPluginEntity->setDisabled(false); | |
| 612 | + $res = $oPluginEntity->update(); | |
| 605 | 613 | } |
| 606 | 614 | } |
| 607 | 615 | KTPluginEntity::clearAllCaches(); | ... | ... |
search2/documentProcessor/documentProcessor.inc.php
| ... | ... | @@ -246,6 +246,11 @@ class DocumentProcessor |
| 246 | 246 | global $default; |
| 247 | 247 | $default->log->debug('documentProcessor: starting processing'); |
| 248 | 248 | |
| 249 | + if($this->processors === false){ | |
| 250 | + $default->log->info('documentProcessor: stopping - no processors enabled'); | |
| 251 | + return ; | |
| 252 | + } | |
| 253 | + | |
| 249 | 254 | // Get processing queue |
| 250 | 255 | // Use the same batch size as the indexer (for now) |
| 251 | 256 | // If the batch size is huge then reset it to a smaller number |
| ... | ... | @@ -286,9 +291,8 @@ class DocumentProcessor |
| 286 | 291 | // Process document |
| 287 | 292 | $processor->setDocument($document); |
| 288 | 293 | $processor->processDocument(); |
| 289 | - | |
| 290 | - Indexer::unqueueDocFromProcessing($docId, "Document processed", 'debug'); | |
| 291 | 294 | } |
| 295 | + Indexer::unqueueDocFromProcessing($docId, "Document processed", 'debug'); | |
| 292 | 296 | } |
| 293 | 297 | } |
| 294 | 298 | ... | ... |