From e9f387cfc3f209256c5239d2034e842851d1df2e 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 Signed-off-by: Andrew Fuerste Henry Signed-off-by: Martin Renvoize Signed-off-by: Andrew Fuerste Henry Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- 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 55b4355f59..7f4593b71b 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.5