From aa8c26ae520667b17286dbac0f63a2583fb1b9e3 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 Signed-off-by: David Cook Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- .../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 aefd39d1e2..a703437b6e 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 @@ -220,7 +220,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 d6a85d39d3..50ee3490c3 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.39.5