Commit 99d18660827f12f99b7dbf10d7f2ff7f675b04cb
1 parent
664911ed
Merged in from DEV trunk...
KTS-673 "The search algorithm needs some work" Updated. updated some error messages Committed By: Conrad Vermeulen Reviewed By: Kevin Fourie KTS-2552 "When searching using the quick search widget, the previous criteria gets corrupted intermittently." Fixed. Committed By: Conrad Vermeulen Reviewed By: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@7560 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
24 additions
and
11 deletions
lib/templating/smartytemplate.inc.php
| ... | ... | @@ -7,32 +7,32 @@ |
| 7 | 7 | * KnowledgeTree Open Source Edition |
| 8 | 8 | * Document Management Made Simple |
| 9 | 9 | * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited |
| 10 | - * | |
| 10 | + * | |
| 11 | 11 | * This program is free software; you can redistribute it and/or modify it under |
| 12 | 12 | * the terms of the GNU General Public License version 3 as published by the |
| 13 | 13 | * Free Software Foundation. |
| 14 | - * | |
| 14 | + * | |
| 15 | 15 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 16 | 16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 17 | 17 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 18 | 18 | * details. |
| 19 | - * | |
| 19 | + * | |
| 20 | 20 | * You should have received a copy of the GNU General Public License |
| 21 | 21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | - * | |
| 22 | + * | |
| 23 | 23 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, |
| 24 | 24 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. |
| 25 | - * | |
| 25 | + * | |
| 26 | 26 | * The interactive user interfaces in modified source and object code versions |
| 27 | 27 | * of this program must display Appropriate Legal Notices, as required under |
| 28 | 28 | * Section 5 of the GNU General Public License version 3. |
| 29 | - * | |
| 29 | + * | |
| 30 | 30 | * In accordance with Section 7(b) of the GNU General Public License version 3, |
| 31 | 31 | * these Appropriate Legal Notices must retain the display of the "Powered by |
| 32 | - * KnowledgeTree" logo and retain the original copyright notice. If the display of the | |
| 32 | + * KnowledgeTree" logo and retain the original copyright notice. If the display of the | |
| 33 | 33 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices |
| 34 | - * must display the words "Powered by KnowledgeTree" and retain the original | |
| 35 | - * copyright notice. | |
| 34 | + * must display the words "Powered by KnowledgeTree" and retain the original | |
| 35 | + * copyright notice. | |
| 36 | 36 | * Contributor( s): ______________________________________ |
| 37 | 37 | */ |
| 38 | 38 | |
| ... | ... | @@ -95,9 +95,12 @@ class KTSmartyTemplate extends KTTemplate { |
| 95 | 95 | } |
| 96 | 96 | else |
| 97 | 97 | { |
| 98 | - $search2_quick=1; | |
| 98 | + $search2_quick=0; | |
| 99 | 99 | $search2_general=1; |
| 100 | 100 | $search2_quickQuery = _kt('Enter search criteria'); |
| 101 | + $_SESSION['search2_quick'] = $search2_quick; | |
| 102 | + $_SESSION['search2_general'] = $search2_general; | |
| 103 | + $_SESSION['search2_quickQuery'] = ''; | |
| 101 | 104 | } |
| 102 | 105 | |
| 103 | 106 | $smarty->assign('search2_quick', $search2_quick); | ... | ... |
search2/indexing/indexerCore.inc.php
| ... | ... | @@ -95,6 +95,7 @@ class QueryResultItem |
| 95 | 95 | |
| 96 | 96 | public function loadDocumentInfo() |
| 97 | 97 | { |
| 98 | + global $default; | |
| 98 | 99 | $sql = "SELECT |
| 99 | 100 | d.folder_id, f.full_path, f.name, dcv.size as filesize, dcv.major_version, |
| 100 | 101 | dcv.minor_version, dcv.filename, cou.name as checkoutuser, w.human_name as workflow, ws.human_name as workflowstate, |
| ... | ... | @@ -121,7 +122,16 @@ class QueryResultItem |
| 121 | 122 | if (PEAR::isError($result) || empty($result)) |
| 122 | 123 | { |
| 123 | 124 | $this->live = false; |
| 124 | - throw new Exception('QueryResultItem::loadDocumentInfo failed'); | |
| 125 | + if (PEAR::isError($result)) | |
| 126 | + { | |
| 127 | + throw new Exception('Database exception! There appears to be an error in the system: ' .$result->getMessage()); | |
| 128 | + } | |
| 129 | + | |
| 130 | + $default->log->error('QueryResultItem: $result is null'); | |
| 131 | + $msg = 'The database did not have a record matching the result from the document indexer. This may occur if there is an inconsistency between the document indexer and the repository. The indexer needs to be repaired. Please consult the administrator guide as to how to repair your indexer.'; | |
| 132 | + $default->log->error('QueryResultItem: ' . $msg); | |
| 133 | + // TODO: repair process where we scan documents in index, and delete those for which there is nothing in the repository | |
| 134 | + throw new Exception(_kt($msg)); | |
| 125 | 135 | } |
| 126 | 136 | |
| 127 | 137 | if (is_null($result['name'])) | ... | ... |