Commit bc6fbad23f0df9f2b002b5a077ea7045895f4aa2
1 parent
b2c5d292
KTC-489
"Upgrade failure (DB error) when upgrading from 3.4.6 and 3.3.7 to 3.5.2c" Fixed. Committed By: Conrad Vermeulen Reviewed By: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8507 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
19 additions
and
13 deletions
lib/upgrades/upgrade.inc.php
| ... | ... | @@ -9,31 +9,31 @@ |
| 9 | 9 | * Document Management Made Simple |
| 10 | 10 | * Copyright (C) 2008 KnowledgeTree Inc. |
| 11 | 11 | * Portions copyright The Jam Warehouse Software (Pty) Limited |
| 12 | - * | |
| 12 | + * | |
| 13 | 13 | * This program is free software; you can redistribute it and/or modify it under |
| 14 | 14 | * the terms of the GNU General Public License version 3 as published by the |
| 15 | 15 | * Free Software Foundation. |
| 16 | - * | |
| 16 | + * | |
| 17 | 17 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 18 | 18 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 19 | 19 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 20 | 20 | * details. |
| 21 | - * | |
| 21 | + * | |
| 22 | 22 | * You should have received a copy of the GNU General Public License |
| 23 | 23 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 24 | - * | |
| 25 | - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, | |
| 24 | + * | |
| 25 | + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, | |
| 26 | 26 | * California 94120-7775, or email info@knowledgetree.com. |
| 27 | - * | |
| 27 | + * | |
| 28 | 28 | * The interactive user interfaces in modified source and object code versions |
| 29 | 29 | * of this program must display Appropriate Legal Notices, as required under |
| 30 | 30 | * Section 5 of the GNU General Public License version 3. |
| 31 | - * | |
| 31 | + * | |
| 32 | 32 | * In accordance with Section 7(b) of the GNU General Public License version 3, |
| 33 | 33 | * these Appropriate Legal Notices must retain the display of the "Powered by |
| 34 | - * KnowledgeTree" logo and retain the original copyright notice. If the display of the | |
| 34 | + * KnowledgeTree" logo and retain the original copyright notice. If the display of the | |
| 35 | 35 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices |
| 36 | - * must display the words "Powered by KnowledgeTree" and retain the original | |
| 36 | + * must display the words "Powered by KnowledgeTree" and retain the original | |
| 37 | 37 | * copyright notice. |
| 38 | 38 | * Contributor( s): ______________________________________ |
| 39 | 39 | */ |
| ... | ... | @@ -62,7 +62,7 @@ function setupAdminDatabase() { |
| 62 | 62 | die($default->_admindb->toString()); |
| 63 | 63 | } |
| 64 | 64 | $default->_admindb->setFetchMode(DB_FETCHMODE_ASSOC); |
| 65 | - return; | |
| 65 | + return; | |
| 66 | 66 | } |
| 67 | 67 | setupAdminDatabase(); |
| 68 | 68 | |
| ... | ... | @@ -100,7 +100,7 @@ function &describeUpgrade ($origVersion, $currVersion) { |
| 100 | 100 | // 7. Add "recordUpgrade" for whole thing |
| 101 | 101 | |
| 102 | 102 | // $recordUpgrade = array('upgrade*' . $currVersion, 'Upgrade to ' . $currVersion, null); |
| 103 | - | |
| 103 | + | |
| 104 | 104 | $steps = array(); |
| 105 | 105 | foreach (array('SQLUpgradeItem', 'FunctionUpgradeItem') as $itemgen) { |
| 106 | 106 | $f = array($itemgen, 'getUpgrades'); |
| ... | ... | @@ -142,6 +142,12 @@ function step_sort_func ($obj1, $obj2) { |
| 142 | 142 | if ($obj1->getPhase() < $obj2->getPhase()) { |
| 143 | 143 | return -1; |
| 144 | 144 | } |
| 145 | + if ($obj1->name < $obj2->name) { | |
| 146 | + return -1; | |
| 147 | + } | |
| 148 | + if ($obj1->name > $obj2->name) { | |
| 149 | + return 1; | |
| 150 | + } | |
| 145 | 151 | return 0; |
| 146 | 152 | } |
| 147 | 153 | // }}} |
| ... | ... | @@ -180,7 +186,7 @@ function compare_version($version1, $version2) { |
| 180 | 186 | function lte_version($version1, $version2) { |
| 181 | 187 | if (in_array(compare_version($version1, $version2), array(-1, 0))) { |
| 182 | 188 | return true; |
| 183 | - } | |
| 189 | + } | |
| 184 | 190 | return false; |
| 185 | 191 | } |
| 186 | 192 | // }} |
| ... | ... | @@ -192,7 +198,7 @@ function lte_version($version1, $version2) { |
| 192 | 198 | function gte_version($version1, $version2) { |
| 193 | 199 | if (in_array(compare_version($version1, $version2), array(0, 1))) { |
| 194 | 200 | return true; |
| 195 | - } | |
| 201 | + } | |
| 196 | 202 | return false; |
| 197 | 203 | } |
| 198 | 204 | // }}} | ... | ... |