From 88d6505cf12cff2b71fb38f9e0eeff3dd5373612 Mon Sep 17 00:00:00 2001 From: kevin_fourie Date: Mon, 25 Feb 2008 13:21:59 +0000 Subject: [PATCH] Merged in from DEV trunk... --- lib/plugins/plugin.inc.php | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/lib/plugins/plugin.inc.php b/lib/plugins/plugin.inc.php index e850207..a8fb776 100644 --- a/lib/plugins/plugin.inc.php +++ b/lib/plugins/plugin.inc.php @@ -685,6 +685,7 @@ class KTPlugin { function register() { $oEntity = KTPluginEntity::getByNamespace($this->sNamespace); $friendly_name = ''; + $iOrder = $this->iOrder; if (!empty($this->sFriendlyName)) { $friendly_name = $this->sFriendlyName; } if (!PEAR::isError($oEntity)) { @@ -695,33 +696,38 @@ class KTPlugin { // remember to -start- the upgrade from the "next" version $iEndVersion = $this->upgradePlugin($oEntity->getVersion()+1, $this->iVersion); - if ($iEndVersion != $this->iVersion) { - // we obviously failed. - $oEntity->updateFromArray(array( + if ($iEndVersion != $this->iVersion) { + // we obviously failed. + $oEntity->updateFromArray(array( 'path' => $this->stripKtDir($this->sFilename), 'version' => $iEndVersion, // as far as we got. 'disabled' => true, 'unavailable' => false, 'friendlyname' => $friendly_name, - )); - // FIXME we -really- need to raise an error here, somehow. + )); + // FIXME we -really- need to raise an error here, somehow. - } else { - $oEntity->updateFromArray(array( + } else { + $oEntity->updateFromArray(array( 'path' => $this->stripKtDir($this->sFilename), 'version' => $this->iVersion, 'unavailable' => false, 'friendlyname' => $friendly_name, - )); + 'orderby' => $iOrder, + )); - } + } } /* ** Quick fix for optimisation. Reread must run plugin setup. ** */ $this->setup(); return $oEntity; } $disabled = 1; - if ($this->bAlwaysInclude || $this->autoRegister) { $disabled = 0; } + + if ($this->bAlwaysInclude || $this->autoRegister) { + $disabled = 0; + } + $iEndVersion = $this->upgradePlugin(0, $this->iVersion); $oEntity = KTPluginEntity::createFromArray(array( 'namespace' => $this->sNamespace, @@ -730,7 +736,9 @@ class KTPlugin { 'disabled' => $disabled, 'unavailable' => false, 'friendlyname' => $friendly_name, - )); + 'orderby' => $iOrder, + )); + if (PEAR::isError($oEntity)) { return $oEntity; } -- libgit2 0.21.4