From ca7e1099307c4a419d0e3732fe2b826cbeae8e3f Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 24 Jul 2023 06:17:13 +0000 Subject: [PATCH] Bug 25672: Prevent uninstall when plugin browser upload disabled When plugin browser upload is disabled, also prevent plugin browser uninstall. Signed-off-by: Kyle M Hall --- .../intranet-tmpl/prog/en/modules/plugins/plugins-home.tt | 2 ++ plugins/plugins-uninstall.pl | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt index c14a3f3ff97..a7c49eee4fc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt @@ -219,7 +219,9 @@ [% END %] [% END %] [% IF ( CAN_user_plugins_manage ) %] + [% IF ( enable_browser_upload ) %]
  • Uninstall
  • + [% END %] [% IF ( plugin.is_enabled ) %]
  • Disable
  • [% ELSE %] diff --git a/plugins/plugins-uninstall.pl b/plugins/plugins-uninstall.pl index d6a85d39d32..50ee3490c31 100755 --- a/plugins/plugins-uninstall.pl +++ b/plugins/plugins-uninstall.pl @@ -38,8 +38,11 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); +my $browser_upload_enabled = C4::Context->config('enable_plugin_browser_upload'); my $class = $input->param('class'); -Koha::Plugins::Handler->delete( { class => $class } ); +if ( $browser_upload_enabled && $class ) { + Koha::Plugins::Handler->delete( { class => $class } ); +} print $input->redirect("/cgi-bin/koha/plugins/plugins-home.pl"); -- 2.30.2