diff --git a/lib/database/schema.inc.php b/lib/database/schema.inc.php index 7ffe70b..b538450 100644 --- a/lib/database/schema.inc.php +++ b/lib/database/schema.inc.php @@ -1012,7 +1012,7 @@ class KTSchemaUtil if (!$result) { - print "..."; + //print "..."; } return $result; diff --git a/plugins/ktcore/KTPermissions.php b/plugins/ktcore/KTPermissions.php index 8ef4b59..373fdc7 100644 --- a/plugins/ktcore/KTPermissions.php +++ b/plugins/ktcore/KTPermissions.php @@ -874,7 +874,7 @@ class KTDocumentRolesAction extends KTDocumentAction { function do_main() { $this->oPage->setTitle(_kt("View Roles")); $this->oPage->setBreadcrumbDetails(_kt("View Roles")); - $oTemplating = new KTTemplating; + $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate("ktcore/action/view_roles"); // we need to have: diff --git a/search2/documentProcessor/documentProcessor.inc.php b/search2/documentProcessor/documentProcessor.inc.php index f048840..273a904 100644 --- a/search2/documentProcessor/documentProcessor.inc.php +++ b/search2/documentProcessor/documentProcessor.inc.php @@ -173,7 +173,6 @@ class DocumentProcessor // indexing starting - create lock file touch($lockFile); - // Process queue foreach($queue as $item){ diff --git a/search2/indexing/extractorCore.inc.php b/search2/indexing/extractorCore.inc.php index c1a0587..17f7ee6 100755 --- a/search2/indexing/extractorCore.inc.php +++ b/search2/indexing/extractorCore.inc.php @@ -695,7 +695,6 @@ abstract class TextExtractor extends DocumentExtractor */ public function extractTextContent() { - $config = KTConfig::getSingleton(); $maxTextSize = $config->get('indexer/maxTextSize', 1024 * 1024 * 10); // we'll only take 10 meg by default $content = file_get_contents($this->sourcefile, null, null, null, $maxTextSize); diff --git a/search2/indexing/indexerCore.inc.php b/search2/indexing/indexerCore.inc.php index 1fce627..b504b8f 100755 --- a/search2/indexing/indexerCore.inc.php +++ b/search2/indexing/indexerCore.inc.php @@ -1255,6 +1255,15 @@ abstract class Indexer // increment indexed documents count Indexer::incrementCount(); + // if document is a zero byte file, let's just unqueue and return + if ($document->getFileSize() == 0) + { + Indexer::unqueueDocument($docinfo['document_id'], + sprintf(_kt("Zero Byte documents do not need to be indexed: %d"), + $docinfo['document_id'])); + return; + } + $docId = $docinfo['document_id']; $extension = $docinfo['filetypes']; $mimeType = $docinfo['mimetypes']; @@ -1312,7 +1321,7 @@ abstract class Indexer Indexer::unqueueDocument($docId,sprintf(_kt("indexDocuments: Filename for document id %d starts with a tilde (~). This is assumed to be a temporary file. This is ignored."),$docId), 'error'); return ; } - + $removeFromQueue = true; if ($indexDocument) { diff --git a/setup/upgrade.php b/setup/upgrade.php index 72b5441..e063b0c 100644 --- a/setup/upgrade.php +++ b/setup/upgrade.php @@ -183,10 +183,11 @@ if (PEAR::isError($dbSupport)) { ?> +