]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #1454: Applied Cash's patch. Bad plugins are automatically disabled and a...
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 26 Jan 2010 01:22:12 +0000 (01:22 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 26 Jan 2010 01:22:12 +0000 (01:22 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3841 36083f99-b078-4883-b0ff-0f9b5a30f544

CHANGES.txt
engine/lib/plugins.php
languages/en.php

index 8b3abe80f954e979cb3b15d709a3080c7e10dcfa..5590e0bec437fbfe98acc221d5ae4b8f486a83b0 100644 (file)
@@ -7,6 +7,7 @@ http://code.elgg.org/elgg/.....
   * Unit tests added to System diagnostics.
   * Debug values output to screen when enabled in admin settings.
   * Users can now log in from multiple computers or browsers concurrently.
+  * Misconfigured plugins no longer break the site. #1454
   * New search system.
 
  Bugfixes:
index 0c8af549713021bd3da9b06c533acee4fc972385..76692b4474d33645bf09230595948650da160459 100644 (file)
@@ -228,7 +228,14 @@ function load_plugins() {
                                if (is_plugin_enabled($mod)) {
                                        if (file_exists($CONFIG->pluginspath . $mod)) {
                                                if (!include($CONFIG->pluginspath . $mod . "/start.php")) {
-                                                       throw new PluginException(sprintf(elgg_echo('PluginException:MisconfiguredPlugin'), $mod));
+                                                       // automatically disable the bad plugin
+                                                       disable_plugin($mod);
+                                                       
+                                                       // register error rather than rendering the site unusable with exception
+                                                       register_error(sprintf(elgg_echo('PluginException:MisconfiguredPlugin'), $mod));
+                                                       
+                                                       // continue loading remaining plugins
+                                                       continue;
                                                }
 
                                                if (!$cached_view_paths) {
index 144d9579ad82dba40a4ee3bfae809f96a8e5ec48..7da28a206c682ac1bcf2afa74dd103f6b3cd116b 100644 (file)
@@ -54,7 +54,7 @@ $english = array(
 
        'InvalidClassException:NotValidElggStar' => "GUID:%d is not a valid %s",
 
-       'PluginException:MisconfiguredPlugin' => "%s is a misconfigured plugin.",
+       'PluginException:MisconfiguredPlugin' => "%s is a misconfigured plugin. It has been disabled. Please see the Elgg wiki for possible causes.",
 
        'InvalidParameterException:NonElggUser' => "Passing a non-ElggUser to an ElggUser constructor!",