View | Details | Raw Unified | Return to bug 31074
Collapse All | Expand All

(-)a/Koha/Plugins.pm (-1 / +12 lines)
Lines 33-38 use C4::Output; Link Here
33
use Koha::Cache::Memory::Lite;
33
use Koha::Cache::Memory::Lite;
34
use Koha::Exceptions::Plugin;
34
use Koha::Exceptions::Plugin;
35
use Koha::Plugins::Methods;
35
use Koha::Plugins::Methods;
36
use Module::Refresh;
36
37
37
use constant ENABLED_PLUGINS_CACHE_KEY => 'enabled_plugins';
38
use constant ENABLED_PLUGINS_CACHE_KEY => 'enabled_plugins';
38
39
Lines 231-241 sub InstallPlugins { Link Here
231
232
232
    my @plugin_classes = $self->plugins();
233
    my @plugin_classes = $self->plugins();
233
    my @plugins;
234
    my @plugins;
235
    my $refresher = Module::Refresh->new;
234
236
235
    foreach my $plugin_class (@plugin_classes) {
237
    foreach my $plugin_class (@plugin_classes) {
236
        if ( can_load( modules => { $plugin_class => undef }, nocache => 1 ) ) {
238
        if ( can_load( modules => { $plugin_class => undef }, nocache => 1 ) ) {
237
            next unless $plugin_class->isa('Koha::Plugins::Base');
239
            next unless $plugin_class->isa('Koha::Plugins::Base');
238
240
241
            # If using Plack or memcached and reinstalling a Plugin that existed previously, the module needs to be refreshed.
242
            my $module_name = ($plugin_class =~ s|::|/|gr) . '.pm';
243
244
            try {
245
                $refresher->refresh_module($module_name);
246
            }
247
            catch {
248
                warn "$_";
249
            };
250
239
            my $plugin;
251
            my $plugin;
240
            my $failed_instantiation;
252
            my $failed_instantiation;
241
253
242
- 

Return to bug 31074