Commit 67d9f73c92b5bb6dc239935792bf1ab0c6b23474
1 parent
8e894d95
Merged in from DEV trunk...
KTS-3043 "On reread of plugins the quicklinks plugin is set to disabled" Fixed. Moved the checks on the end version after an upgrade into the if statement containing the upgrade. Committed By: Megan Watson Reviewed By: Conrad Vermeulen git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@8076 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
24 additions
and
23 deletions
lib/metadata/metadatautil.inc.php
| @@ -2,39 +2,37 @@ | @@ -2,39 +2,37 @@ | ||
| 2 | /** | 2 | /** |
| 3 | * $Id$ | 3 | * $Id$ |
| 4 | * | 4 | * |
| 5 | - * Utility functions for retrieving information from and managing | ||
| 6 | - * fieldsets with conditions. | ||
| 7 | - * | ||
| 8 | * KnowledgeTree Open Source Edition | 5 | * KnowledgeTree Open Source Edition |
| 9 | * Document Management Made Simple | 6 | * Document Management Made Simple |
| 10 | * Copyright (C) 2004 - 2008 The Jam Warehouse Software (Pty) Limited | 7 | * Copyright (C) 2004 - 2008 The Jam Warehouse Software (Pty) Limited |
| 11 | - * | 8 | + * |
| 12 | * This program is free software; you can redistribute it and/or modify it under | 9 | * This program is free software; you can redistribute it and/or modify it under |
| 13 | * the terms of the GNU General Public License version 3 as published by the | 10 | * the terms of the GNU General Public License version 3 as published by the |
| 14 | * Free Software Foundation. | 11 | * Free Software Foundation. |
| 15 | - * | 12 | + * |
| 16 | * This program is distributed in the hope that it will be useful, but WITHOUT | 13 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 17 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 18 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 19 | * details. | 16 | * details. |
| 20 | - * | 17 | + * |
| 21 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
| 22 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 23 | - * | 20 | + * |
| 24 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, | 21 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, |
| 25 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. | 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. |
| 26 | - * | 23 | + * |
| 27 | * The interactive user interfaces in modified source and object code versions | 24 | * The interactive user interfaces in modified source and object code versions |
| 28 | * of this program must display Appropriate Legal Notices, as required under | 25 | * of this program must display Appropriate Legal Notices, as required under |
| 29 | * Section 5 of the GNU General Public License version 3. | 26 | * Section 5 of the GNU General Public License version 3. |
| 30 | - * | 27 | + * |
| 31 | * In accordance with Section 7(b) of the GNU General Public License version 3, | 28 | * In accordance with Section 7(b) of the GNU General Public License version 3, |
| 32 | * these Appropriate Legal Notices must retain the display of the "Powered by | 29 | * these Appropriate Legal Notices must retain the display of the "Powered by |
| 33 | - * KnowledgeTree" logo and retain the original copyright notice. If the display of the | 30 | + * KnowledgeTree" logo and retain the original copyright notice. If the display of the |
| 34 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices | 31 | * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices |
| 35 | - * must display the words "Powered by KnowledgeTree" and retain the original | ||
| 36 | - * copyright notice. | 32 | + * must display the words "Powered by KnowledgeTree" and retain the original |
| 33 | + * copyright notice. | ||
| 37 | * Contributor( s): ______________________________________ | 34 | * Contributor( s): ______________________________________ |
| 35 | + * | ||
| 38 | */ | 36 | */ |
| 39 | 37 | ||
| 40 | require_once(KT_LIB_DIR . "/ktentity.inc"); | 38 | require_once(KT_LIB_DIR . "/ktentity.inc"); |
| @@ -76,6 +74,9 @@ class KTMetadataUtil { | @@ -76,6 +74,9 @@ class KTMetadataUtil { | ||
| 76 | */ | 74 | */ |
| 77 | 75 | ||
| 78 | $oBehaviour =& KTUtil::getObject('KTFieldBehaviour', $oBehaviour); | 76 | $oBehaviour =& KTUtil::getObject('KTFieldBehaviour', $oBehaviour); |
| 77 | + if(PEAR::isError($oBehaviour)) { | ||
| 78 | + return array(); | ||
| 79 | + } | ||
| 79 | 80 | ||
| 80 | $GLOBALS['default']->log->debug('KTMetadataUtil::_getNextForBehaviour, behaviour is ' . $oBehaviour->getId()); | 81 | $GLOBALS['default']->log->debug('KTMetadataUtil::_getNextForBehaviour, behaviour is ' . $oBehaviour->getId()); |
| 81 | 82 | ||
| @@ -189,6 +190,7 @@ class KTMetadataUtil { | @@ -189,6 +190,7 @@ class KTMetadataUtil { | ||
| 189 | //var_dump($lookup); exit(0); | 190 | //var_dump($lookup); exit(0); |
| 190 | $oValueInstance = KTValueInstance::getByLookupSingle($lookup); | 191 | $oValueInstance = KTValueInstance::getByLookupSingle($lookup); |
| 191 | if (PEAR::isError($oValueInstance) || is_null($oValueInstance) || ($oValueInstance === false)) { return true; } // throw an error | 192 | if (PEAR::isError($oValueInstance) || is_null($oValueInstance) || ($oValueInstance === false)) { return true; } // throw an error |
| 193 | + | ||
| 192 | $aValues = KTMetadataUtil::_getNextForBehaviour($oValueInstance->getBehaviourId(), $aCurrentSelections); | 194 | $aValues = KTMetadataUtil::_getNextForBehaviour($oValueInstance->getBehaviourId(), $aCurrentSelections); |
| 193 | $GLOBALS['default']->log->debug('KTMetadataUtil::getNext, values are ' . print_r($aValues, true)); | 195 | $GLOBALS['default']->log->debug('KTMetadataUtil::getNext, values are ' . print_r($aValues, true)); |
| 194 | $aReturn = array(); | 196 | $aReturn = array(); |
lib/plugins/plugin.inc.php
| @@ -694,7 +694,6 @@ class KTPlugin { | @@ -694,7 +694,6 @@ class KTPlugin { | ||
| 694 | // capture the filname version. | 694 | // capture the filname version. |
| 695 | // remember to -start- the upgrade from the "next" version | 695 | // remember to -start- the upgrade from the "next" version |
| 696 | $iEndVersion = $this->upgradePlugin($oEntity->getVersion()+1, $this->iVersion); | 696 | $iEndVersion = $this->upgradePlugin($oEntity->getVersion()+1, $this->iVersion); |
| 697 | - } | ||
| 698 | 697 | ||
| 699 | if ($iEndVersion != $this->iVersion) { | 698 | if ($iEndVersion != $this->iVersion) { |
| 700 | // we obviously failed. | 699 | // we obviously failed. |
| @@ -716,6 +715,7 @@ class KTPlugin { | @@ -716,6 +715,7 @@ class KTPlugin { | ||
| 716 | )); | 715 | )); |
| 717 | 716 | ||
| 718 | } | 717 | } |
| 718 | + } | ||
| 719 | /* ** Quick fix for optimisation. Reread must run plugin setup. ** */ | 719 | /* ** Quick fix for optimisation. Reread must run plugin setup. ** */ |
| 720 | $this->setup(); | 720 | $this->setup(); |
| 721 | return $oEntity; | 721 | return $oEntity; |
plugins/ktcore/admin/fieldsets/conditional.inc.php
| 1 | <?php | 1 | <?php |
| 2 | - | ||
| 3 | /** | 2 | /** |
| 4 | * $Id$ | 3 | * $Id$ |
| 5 | * | 4 | * |
| 6 | * KnowledgeTree Open Source Edition | 5 | * KnowledgeTree Open Source Edition |
| 7 | * Document Management Made Simple | 6 | * Document Management Made Simple |
| 8 | * Copyright (C) 2004 - 2008 The Jam Warehouse Software (Pty) Limited | 7 | * Copyright (C) 2004 - 2008 The Jam Warehouse Software (Pty) Limited |
| 9 | - * | 8 | + * |
| 10 | * This program is free software; you can redistribute it and/or modify it under | 9 | * 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 | 10 | * the terms of the GNU General Public License version 3 as published by the |
| 12 | * Free Software Foundation. | 11 | * Free Software Foundation. |
| 13 | - * | 12 | + * |
| 14 | * This program is distributed in the hope that it will be useful, but WITHOUT | 13 | * 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 | 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 16 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 17 | * details. | 16 | * details. |
| 18 | - * | 17 | + * |
| 19 | * You should have received a copy of the GNU General Public License | 18 | * 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/>. | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 21 | - * | 20 | + * |
| 22 | * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, | 21 | * 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. | 22 | * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. |
| 24 | - * | 23 | + * |
| 25 | * The interactive user interfaces in modified source and object code versions | 24 | * The interactive user interfaces in modified source and object code versions |
| 26 | * of this program must display Appropriate Legal Notices, as required under | 25 | * of this program must display Appropriate Legal Notices, as required under |
| 27 | * Section 5 of the GNU General Public License version 3. | 26 | * Section 5 of the GNU General Public License version 3. |
| 28 | - * | 27 | + * |
| 29 | * In accordance with Section 7(b) of the GNU General Public License version 3, | 28 | * 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 | 29 | * 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 | 30 | + * 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 | 31 | * 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. | 32 | + * must display the words "Powered by KnowledgeTree" and retain the original |
| 33 | + * copyright notice. | ||
| 35 | * Contributor( s): ______________________________________ | 34 | * Contributor( s): ______________________________________ |
| 36 | * | 35 | * |
| 37 | */ | 36 | */ |