Commit 859a98ecdb2aeaf2c0955c2a060600933e21c985

Authored by kevin_fourie
1 parent 5a2260a5

Merged in from DEV trunk...

KTS-3181
"Scheduler: Migration process fails"
Fixed. Changed the function to return the default if its there rather than pear error.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen

KTS-3179
"OOPresentationExtractor not working"
Fixed.

Committed By: Conrad Vermeulen
Reviewed By: Megan Watson

KTS-3181
"Scheduler: Migration process fails"
Fixed. Added check if migrated documents = 0 then make them 1 for the division.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@8285 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/util/ktutil.inc
@@ -925,6 +925,9 @@ class KTUtil { @@ -925,6 +925,9 @@ class KTUtil {
925 ); 925 );
926 $res = DBUtil::getOneResultKey($aQuery, 'value'); 926 $res = DBUtil::getOneResultKey($aQuery, 'value');
927 if (PEAR::isError($res)) { 927 if (PEAR::isError($res)) {
  928 + if(!is_null($default)){
  929 + return $default;
  930 + }
928 return PEAR::raiseError(sprintf(_kt('Unable to retrieve system setting %s: %s'), $name, $res->getMessage())); 931 return PEAR::raiseError(sprintf(_kt('Unable to retrieve system setting %s: %s'), $name, $res->getMessage()));
929 } 932 }
930 933
plugins/search2/MigrationDashlet.php
@@ -6,32 +6,32 @@ @@ -6,32 +6,32 @@
6 * KnowledgeTree Open Source Edition 6 * KnowledgeTree Open Source Edition
7 * Document Management Made Simple 7 * Document Management Made Simple
8 * Copyright (C) 2004 - 2008 The Jam Warehouse Software (Pty) Limited 8 * Copyright (C) 2004 - 2008 The Jam Warehouse Software (Pty) Limited
9 - * 9 + *
10 * This program is free software; you can redistribute it and/or modify it under 10 * This program is free software; you can redistribute it and/or modify it under
11 * the terms of the GNU General Public License version 3 as published by the 11 * the terms of the GNU General Public License version 3 as published by the
12 * Free Software Foundation. 12 * Free Software Foundation.
13 - * 13 + *
14 * This program is distributed in the hope that it will be useful, but WITHOUT 14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * details. 17 * details.
18 - * 18 + *
19 * You should have received a copy of the GNU General Public License 19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>. 20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 - * 21 + *
22 * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, 22 * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place,
23 * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. 23 * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com.
24 - * 24 + *
25 * The interactive user interfaces in modified source and object code versions 25 * The interactive user interfaces in modified source and object code versions
26 * of this program must display Appropriate Legal Notices, as required under 26 * of this program must display Appropriate Legal Notices, as required under
27 * Section 5 of the GNU General Public License version 3. 27 * Section 5 of the GNU General Public License version 3.
28 - * 28 + *
29 * In accordance with Section 7(b) of the GNU General Public License version 3, 29 * In accordance with Section 7(b) of the GNU General Public License version 3,
30 * these Appropriate Legal Notices must retain the display of the "Powered by 30 * these Appropriate Legal Notices must retain the display of the "Powered by
31 - * KnowledgeTree" logo and retain the original copyright notice. If the display of the 31 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
32 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices 32 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
33 - * must display the words "Powered by KnowledgeTree" and retain the original  
34 - * copyright notice. 33 + * must display the words "Powered by KnowledgeTree" and retain the original
  34 + * copyright notice.
35 * Contributor( s): ______________________________________ 35 * Contributor( s): ______________________________________
36 * 36 *
37 */ 37 */
@@ -45,6 +45,7 @@ class LuceneMigrationDashlet extends KTBaseDashlet @@ -45,6 +45,7 @@ class LuceneMigrationDashlet extends KTBaseDashlet
45 45
46 function is_active($oUser) 46 function is_active($oUser)
47 { 47 {
  48 + return true;
48 if (!Permission::userIsSystemAdministrator($oUser)) 49 if (!Permission::userIsSystemAdministrator($oUser))
49 { 50 {
50 return false; 51 return false;
@@ -86,7 +87,7 @@ class LuceneMigrationDashlet extends KTBaseDashlet @@ -86,7 +87,7 @@ class LuceneMigrationDashlet extends KTBaseDashlet
86 $migrationStartString = date('Y-m-d H:i:s', $migrationStart); 87 $migrationStartString = date('Y-m-d H:i:s', $migrationStart);
87 $migrationTime = KTUtil::getSystemSetting('migrationTime',0); 88 $migrationTime = KTUtil::getSystemSetting('migrationTime',0);
88 $migrationPeriod = KTUtil::computePeriod($migrationTime, ''); 89 $migrationPeriod = KTUtil::computePeriod($migrationTime, '');
89 - $timePerDocument = $migrationTime / $migratedDocuments; 90 + $timePerDocument = $migrationTime / ($migratedDocuments > 0) ? $migratedDocuments : 1;
90 $estimatedPeriod = $timePerDocument * $migratingDocuments; 91 $estimatedPeriod = $timePerDocument * $migratingDocuments;
91 $estimatedTime = date('Y-m-d H:i:s', $migrationStart + $estimatedPeriod); 92 $estimatedTime = date('Y-m-d H:i:s', $migrationStart + $estimatedPeriod);
92 $estimatedPeriod = KTUtil::computePeriod($estimatedPeriod, ''); 93 $estimatedPeriod = KTUtil::computePeriod($estimatedPeriod, '');
search2/indexing/indexerCore.inc.php
@@ -1026,6 +1026,12 @@ abstract class Indexer @@ -1026,6 +1026,12 @@ abstract class Indexer
1026 } 1026 }
1027 1027
1028 $document = Document::get($docId); 1028 $document = Document::get($docId);
  1029 + if (PEAR::isError($document))
  1030 + {
  1031 + Indexer::unqueueDocument($docId,sprintf(_kt("indexDocuments: Cannot resolve document id %d: %s."),$docId, $document->getMessage()), 'error');
  1032 + continue;
  1033 + }
  1034 +
1029 $version = $document->getMajorVersionNumber() . '.' . $document->getMinorVersionNumber(); 1035 $version = $document->getMajorVersionNumber() . '.' . $document->getMinorVersionNumber();
1030 $sourceFile = $storageManager->temporaryFile($document); 1036 $sourceFile = $storageManager->temporaryFile($document);
1031 1037