Bug 10403: (follow-up) fix test to use vendor created earlier during test
[koha.git] / Koha / Plugins.pm
index bc4a3bb..3b31fc5 100644 (file)
@@ -38,7 +38,7 @@ Koha::Plugins - Module for loading and managing plugins.
 sub new {
     my ( $class, $args ) = @_;
 
-    die('Plugins not enabled in config') unless ( C4::Context->config("enable_plugins") || $args->{'enable_plugins'} );
+    return unless ( C4::Context->config("enable_plugins") || $args->{'enable_plugins'} );
 
     $args->{'pluginsdir'} = C4::Context->config("pluginsdir");
 
@@ -63,7 +63,7 @@ sub GetPlugins {
 
     foreach my $plugin_class (@plugin_classes) {
         if ( can_load( modules => { $plugin_class => undef } ) ) {
-            my $plugin = $plugin_class->new();
+            my $plugin = $plugin_class->new({ enable_plugins => $self->{'enable_plugins'} });
 
             if ($method) {
                 if ( $plugin->can($method) ) {