diff --git a/lib/plugins/plugin.inc.php b/lib/plugins/plugin.inc.php index e96b106..b35b71b 100644 --- a/lib/plugins/plugin.inc.php +++ b/lib/plugins/plugin.inc.php @@ -713,6 +713,8 @@ class KTPlugin { $oEntity = KTPluginEntity::getByNamespace($this->sNamespace); $friendly_name = ''; $iOrder = $this->iOrder; + global $default; + if (!empty($this->sFriendlyName)) { $friendly_name = $this->sFriendlyName; } if (!PEAR::isError($oEntity)) { @@ -724,6 +726,8 @@ class KTPlugin { $iEndVersion = $this->upgradePlugin($oEntity->getVersion()+1, $this->iVersion); if ($iEndVersion != $this->iVersion) { + $default->log->error("Plugin register: {$friendly_name}, namespace: {$this->sNamespace} failed to upgrade properly. Original version: {$oEntity->getVersion()}, upgrading to version {$this->iVersion}, current version {$iEndVersion}"); + // we obviously failed. $oEntity->updateFromArray(array( 'path' => $this->stripKtDir($this->sFilename), @@ -735,6 +739,8 @@ class KTPlugin { // FIXME we -really- need to raise an error here, somehow. } else { + $default->log->debug("Plugin register: {$friendly_name}, namespace: {$this->sNamespace} upgraded. Original version: {$oEntity->getVersion()}, upgrading to version {$this->iVersion}, current version {$iEndVersion}"); + $oEntity->updateFromArray(array( 'path' => $this->stripKtDir($this->sFilename), 'version' => $this->iVersion, @@ -750,6 +756,7 @@ class KTPlugin { return $oEntity; } if(PEAR::isError($oEntity) && !is_a($oEntity, 'KTEntityNoObjects')){ + $default->log->error("Plugin register: the plugin {$friendly_name}, namespace: {$this->sNamespace} returned an error: ".$oEntity->getMessage()); return $oEntity; } @@ -759,6 +766,8 @@ class KTPlugin { $disabled = 0; } + $default->log->debug("Plugin register: creating {$friendly_name}, namespace: {$this->sNamespace}"); + $iEndVersion = $this->upgradePlugin(0, $this->iVersion); $oEntity = KTPluginEntity::createFromArray(array( 'namespace' => $this->sNamespace, @@ -771,6 +780,7 @@ class KTPlugin { )); if (PEAR::isError($oEntity)) { + $default->log->error("Plugin register: the plugin, {$friendly_name}, namespace: {$this->sNamespace} returned an error on creation: ".$oEntity->getMessage()); return $oEntity; } diff --git a/lib/plugins/pluginentity.inc.php b/lib/plugins/pluginentity.inc.php index 9ff54ca..34b6086 100644 --- a/lib/plugins/pluginentity.inc.php +++ b/lib/plugins/pluginentity.inc.php @@ -6,31 +6,31 @@ * Document Management Made Simple * Copyright (C) 2008, 2009 KnowledgeTree Inc. * Portions copyright The Jam Warehouse Software (Pty) Limited - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, + * + * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, * California 94120-7775, or email info@knowledgetree.com. - * + * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. - * + * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by - * KnowledgeTree" logo and retain the original copyright notice. If the display of the + * KnowledgeTree" logo and retain the original copyright notice. If the display of the * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices - * must display the words "Powered by KnowledgeTree" and retain the original + * must display the words "Powered by KnowledgeTree" and retain the original * copyright notice. * Contributor( s): ______________________________________ * @@ -111,7 +111,7 @@ class KTPluginEntity extends KTEntity { // STATIC function &getAvailable() { - $aOptions = array('multi' => true); + $aOptions = array('multi' => true, 'orderby' => 'friendly_name'); return KTEntityUtil::getBy('KTPluginEntity', 'unavailable', false, $aOptions); }