Commit 298d10c1640a90ee108f6a6e6d5e94d6abf59054
1 parent
56eb0eca
Added registerPlugins() at the end of the upgrade and after enabling/disabling plugins.
Committed by: Megan Watson Reviewed by: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/branches/RB_3.5.4a@9644 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
16 additions
and
12 deletions
plugins/ktcore/admin/plugins.php
| @@ -148,6 +148,8 @@ class KTPluginDispatcher extends KTAdminDispatcher { | @@ -148,6 +148,8 @@ class KTPluginDispatcher extends KTAdminDispatcher { | ||
| 148 | } | 148 | } |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | + // we reregister the plugins to ensure they are in the correct order | ||
| 152 | + KTPluginUtil::registerPlugins(); | ||
| 151 | $this->successRedirectToMain(_kt('Plugins updated')); | 153 | $this->successRedirectToMain(_kt('Plugins updated')); |
| 152 | } | 154 | } |
| 153 | 155 |
setup/upgrade.php
| @@ -145,15 +145,11 @@ function performPostUpgradeActions() { | @@ -145,15 +145,11 @@ function performPostUpgradeActions() { | ||
| 145 | 145 | ||
| 146 | global $default; | 146 | global $default; |
| 147 | 147 | ||
| 148 | - // Unlock the scheduler | ||
| 149 | - $lockFile = $default->cacheDirectory . DIRECTORY_SEPARATOR . 'scheduler.lock'; | ||
| 150 | - if(file_exists($lockFile)){ | ||
| 151 | - unlink($lockFile); | ||
| 152 | - } | 148 | + // Ensure all plugins are registered. |
| 149 | + $sql = "DELETE FROM plugin_helper"; | ||
| 150 | + $res = DBUtil::runQuery($sql); | ||
| 153 | 151 | ||
| 154 | - // Clear the configuration cache, it'll regenerate on next load | ||
| 155 | - $oKTConfig = new KTConfig(); | ||
| 156 | - $oKTConfig->clearCache(); | 152 | + KTPluginUtil::registerPlugins(); |
| 157 | 153 | ||
| 158 | // Clear out all caches and proxies - they need to be regenerated with the new code | 154 | // Clear out all caches and proxies - they need to be regenerated with the new code |
| 159 | $proxyDir = $default->proxyCacheDirectory; | 155 | $proxyDir = $default->proxyCacheDirectory; |
| @@ -162,11 +158,17 @@ function performPostUpgradeActions() { | @@ -162,11 +158,17 @@ function performPostUpgradeActions() { | ||
| 162 | $oKTCache = new KTCache(); | 158 | $oKTCache = new KTCache(); |
| 163 | $oKTCache->deleteAllCaches(); | 159 | $oKTCache->deleteAllCaches(); |
| 164 | 160 | ||
| 165 | - // Clean out the plugin_helper table | ||
| 166 | - $sql = "DELETE FROM plugin_helper"; | ||
| 167 | - $res = DBUtil::runQuery($sql); | 161 | + // Clear the configuration cache, it'll regenerate on next load |
| 162 | + $oKTConfig = new KTConfig(); | ||
| 163 | + $oKTConfig->clearCache(); | ||
| 168 | 164 | ||
| 169 | - return $res; | 165 | + // Unlock the scheduler |
| 166 | + $lockFile = $default->cacheDirectory . DIRECTORY_SEPARATOR . 'scheduler.lock'; | ||
| 167 | + if(file_exists($lockFile)){ | ||
| 168 | + @unlink($lockFile); | ||
| 169 | + } | ||
| 170 | + | ||
| 171 | + return true; | ||
| 170 | 172 | ||
| 171 | } | 173 | } |
| 172 | 174 |