Lines 161-173
sub InstallPlugins {
Link Here
|
161 |
my @plugin_classes = $self->plugins(); |
161 |
my @plugin_classes = $self->plugins(); |
162 |
my @plugins; |
162 |
my @plugins; |
163 |
|
163 |
|
|
|
164 |
# If we can reload the plugin we will add the methods back, if not they should be removed |
165 |
Koha::Plugins::Methods->search()->delete(); |
164 |
foreach my $plugin_class (@plugin_classes) { |
166 |
foreach my $plugin_class (@plugin_classes) { |
165 |
if ( can_load( modules => { $plugin_class => undef }, nocache => 1 ) ) { |
167 |
if ( can_load( modules => { $plugin_class => undef }, nocache => 1 ) ) { |
166 |
next unless $plugin_class->isa('Koha::Plugins::Base'); |
168 |
next unless $plugin_class->isa('Koha::Plugins::Base'); |
167 |
|
169 |
|
168 |
my $plugin = $plugin_class->new({ enable_plugins => $self->{'enable_plugins'} }); |
170 |
my $plugin = $plugin_class->new({ enable_plugins => $self->{'enable_plugins'} }); |
169 |
|
171 |
|
170 |
Koha::Plugins::Methods->search({ plugin_class => $plugin_class })->delete(); |
|
|
171 |
|
172 |
|
172 |
foreach my $method ( @{ Class::Inspector->methods( $plugin_class, 'public' ) } ) { |
173 |
foreach my $method ( @{ Class::Inspector->methods( $plugin_class, 'public' ) } ) { |
173 |
Koha::Plugins::Method->new( |
174 |
Koha::Plugins::Method->new( |