@@ -, +, @@ https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/releases --- Koha/Plugins.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/Koha/Plugins.pm +++ a/Koha/Plugins.pm @@ -33,6 +33,7 @@ use C4::Output; use Koha::Cache::Memory::Lite; use Koha::Exceptions::Plugin; use Koha::Plugins::Methods; +use Module::Refresh; use constant ENABLED_PLUGINS_CACHE_KEY => 'enabled_plugins'; @@ -231,11 +232,22 @@ sub InstallPlugins { my @plugin_classes = $self->plugins(); my @plugins; + my $refresher = Module::Refresh->new; foreach my $plugin_class (@plugin_classes) { if ( can_load( modules => { $plugin_class => undef }, nocache => 1 ) ) { next unless $plugin_class->isa('Koha::Plugins::Base'); + # If using Plack or memcached and reinstalling a Plugin that existed previously, the module needs to be refreshed. + my $module_name = ($plugin_class =~ s|::|/|gr) . '.pm'; + + try { + $refresher->refresh_module($module_name); + } + catch { + warn "$_"; + }; + my $plugin; my $failed_instantiation; --