From ec95dcf05ca812e290e3c215a4ae2b7415153b08 Mon Sep 17 00:00:00 2001 From: Conrad Vermeulen Date: Thu, 3 Apr 2008 11:44:50 +0000 Subject: [PATCH] KTS-3236 "Indexing process should skip temporary files as the indexer process is likely to fail resulting in users being confused." Fixed. --- search2/indexing/indexerCore.inc.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/search2/indexing/indexerCore.inc.php b/search2/indexing/indexerCore.inc.php index 7eec023..c146056 100755 --- a/search2/indexing/indexerCore.inc.php +++ b/search2/indexing/indexerCore.inc.php @@ -1012,6 +1012,20 @@ abstract class Indexer $this->logPendingDocumentInfoStatus($docId, sprintf(_kt("Processing docid: %d.\n"),$docId), 'info'); } + $document = Document::get($docId); + if (PEAR::isError($document)) + { + Indexer::unqueueDocument($docId,sprintf(_kt("indexDocuments: Cannot resolve document id %d: %s."),$docId, $document->getMessage()), 'error'); + continue; + } + + $filename = $document->getFileName(); + if (substr($filename,0,1) == '~') + { + 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'); + continue; + } + $removeFromQueue = true; if ($indexDocument) { @@ -1030,12 +1044,7 @@ abstract class Indexer continue; } - $document = Document::get($docId); - if (PEAR::isError($document)) - { - Indexer::unqueueDocument($docId,sprintf(_kt("indexDocuments: Cannot resolve document id %d: %s."),$docId, $document->getMessage()), 'error'); - continue; - } + $version = $document->getMajorVersionNumber() . '.' . $document->getMinorVersionNumber(); $sourceFile = $storageManager->temporaryFile($document); -- libgit2 0.21.4