From c0c581c5ee3b97066bd3ac50299f88f923ec872b Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 21 Feb 2024 14:56:41 -0500 Subject: [PATCH] Bug 34478: Manual fix - add cud- op - alert-subscriptions.pl Signed-off-by: Jonathan Druart --- .../prog/en/modules/members/alert-subscriptions.tt | 1 + members/alert-subscriptions.pl | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/alert-subscriptions.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/alert-subscriptions.tt index bff2d38674..14ba776d4a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/alert-subscriptions.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/alert-subscriptions.tt @@ -71,6 +71,7 @@
[% INCLUDE 'csrf-token.inc' %] + diff --git a/members/alert-subscriptions.pl b/members/alert-subscriptions.pl index f1bd12cffc..941b025b88 100755 --- a/members/alert-subscriptions.pl +++ b/members/alert-subscriptions.pl @@ -19,7 +19,7 @@ use Modern::Perl; -use CGI qw ( -utf8 ); +use CGI qw ( -utf8 ); use C4::Auth qw( get_template_and_user ); use C4::Context; use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); @@ -37,6 +37,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( ); my $borrowernumber = $input->param('borrowernumber'); +my $op = $input->param('op'); my $logged_in_user = Koha::Patrons->find($loggedinuser); my $patron = Koha::Patrons->find($borrowernumber); @@ -45,9 +46,9 @@ output_and_exit_if_error( { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); -my $subscription_id = $input->param('subscription_id'); -if ($subscription_id) { - my $subscription = Koha::Subscriptions->find($subscription_id); +if ( $op eq 'cud-unsubscribe' ) { + my $subscription_id = $input->param('subscription_id'); + my $subscription = Koha::Subscriptions->find($subscription_id); $subscription->remove_subscriber($patron); print $input->redirect( "/cgi-bin/koha/members/alert-subscriptions.pl?borrowernumber=" . $borrowernumber ); } -- 2.39.5