Bug 21111: Add --exclude-indexes to koha-run-backups
[koha-ffzg.git] / Koha / Plugins.pm
index 77758fb..36e6090 100644 (file)
@@ -164,14 +164,13 @@ sub InstallPlugins {
     my @plugin_classes = $self->plugins();
     my @plugins;
 
-    # If we can reload the plugin we will add the methods back, if not they should be removed
-    Koha::Plugins::Methods->search()->delete();
     foreach my $plugin_class (@plugin_classes) {
         if ( can_load( modules => { $plugin_class => undef }, nocache => 1 ) ) {
             next unless $plugin_class->isa('Koha::Plugins::Base');
 
             my $plugin = $plugin_class->new({ enable_plugins => $self->{'enable_plugins'} });
 
+            Koha::Plugins::Methods->search({ plugin_class => $plugin_class })->delete();
 
             foreach my $method ( @{ Class::Inspector->methods( $plugin_class, 'public' ) } ) {
                 Koha::Plugins::Method->new(