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