Bug 17461: Warn about plugins that can't be loaded
authorMagnus Enger <magnus@libriotech.no>
Tue, 18 Oct 2016 09:47:19 +0000 (09:47 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 17 Feb 2017 17:19:22 +0000 (17:19 +0000)
The logs should have some info if a module has been installed that can
not be loaded.

To test:
- Make sure you have an up to date dev install
- Install v1.0 of the KitchenSink plugin from
  https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases
- Make sure the plugin does not show up in the list of installed
  plugins, and that the intranet-error.log has no info about it
- Apply the patch
- Reload plugins-home.pl
- Verify that there is now some interesting info in intranet-error.log

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Works as advertised, generates useful diagnostic information in the form of a log entry to either intranet-error or plack-error.log. Relief, thanks Magnus!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/Plugins.pm

index 45da6d0..ef1ab25 100644 (file)
@@ -86,6 +86,8 @@ sub GetPlugins {
                 and %$req_metadata
                 and any { !$plugin_metadata->{$_} || $plugin_metadata->{$_} ne $req_metadata->{$_} } keys %$req_metadata;
             push @plugins, $plugin;
+        } else {
+            warn $Module::Load::Conditional::ERROR;
         }
     }
     return @plugins;