Commit d05703b05dc63829b4f8ef2f0145a4fe0045c582

Authored by donald_jackson
1 parent 6bbd83df

"Fatal error after having updated and reread the plugins a few times on Windows …

…XP and Windows Vista."
KTC-649
Plugins were being re-read 'twice' causing havoc with the plugin registry, have implemented a super global parameter to re-read plugins before any other activity takes place.

Committed by: Donald Jackson
Reviewed by: Kevin Fourie

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/branches/RB_3.5.4a@9685 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/plugins/pluginutil.inc.php
... ... @@ -180,7 +180,7 @@ class KTPluginUtil {
180 180 }
181 181  
182 182 // Check that there are plugins and if not, register them
183   - if (empty($aPluginHelpers)) {
  183 + if (empty($aPluginHelpers) || (isset($_POST['_force_plugin_truncate']))) {
184 184 DBUtil::startTransaction();
185 185 KTPluginUtil::registerPlugins();
186 186 DBUtil::commit();
... ...
plugins/ktcore/admin/plugins.php
... ... @@ -154,7 +154,11 @@ class KTPluginDispatcher extends KTAdminDispatcher {
154 154 }
155 155  
156 156 function do_reread() {
157   - KTPluginUtil::registerPlugins();
  157 + /**
  158 + * The plugin re-register is now handled by the super global _force_plugin_truncate
  159 + * in pluginutil.inc.php
  160 + * KTPluginUtil::registerPlugins();
  161 + */
158 162 $this->successRedirectToMain(_kt('Plugins read from the filesystem'));
159 163 }
160 164 }
... ...
templates/ktcore/plugins/list.smarty
... ... @@ -21,6 +21,7 @@ must be re-read from the filesystem{/i18n}</p>
21 21  
22 22 <form action="{$smarty.server.PHP_SELF}" method="POST">
23 23 <input type="hidden" name="action" value="reread" />
  24 +<input type="hidden" name="_force_plugin_truncate" value="1" />
24 25 <input type="submit" name="submit" value="{i18n}Reread plugins{/i18n}" />
25 26 </form>
26 27  
... ...