From ea30eb577992e98d01630c334293871a78a293b4 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 10 Apr 2024 00:58:30 +0000 Subject: [PATCH] Bug 32256: (follow-up) Use correct patron category This patch ensures we check the categorycode of the patron trying to issue the items is valid (based on BatchCheckoutsValidCategories), rather than the categorycode of the AutoSelfCheckAllowed patron. To test: 1 - Enable BatchCheckouts, select nothing in BatchCheckoutsValidCategories 2 - confirm AutoSelfCheckAllowed is allowed and contains the username and password for the self_check user. Confirm self_check user is in category Staff 3 - log into SCO with a user in category Patron, confirm you can only check out 1 item at a time 4 - select Patron in BatchCheckoutsValidCategories 5 - log into SCO with your Patron user again, confirm you can check out multiple items at a time Sponsored-by: Koha-US --- opac/sco/sco-main.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl index 55b4355f597..7f4593b71b2 100755 --- a/opac/sco/sco-main.pl +++ b/opac/sco/sco-main.pl @@ -138,9 +138,9 @@ my $branch = $issuer->{branchcode}; my $confirm_required = 0; my $return_only = 0; -if ( C4::Context->preference('BatchCheckouts') ) { +if ( C4::Context->preference('BatchCheckouts') and $patron ) { my @batch_category_codes = split ',', C4::Context->preference('BatchCheckoutsValidCategories'); - my $categorycode = $issuer->{categorycode}; + my $categorycode = $patron->categorycode; if ( $categorycode && grep { $_ eq $categorycode } @batch_category_codes ) { # do nothing - logged in patron is allowed to do batch checkouts } else { -- 2.39.2