From 4b4028d783a3660b9e16e647ef0e51c624ef3ff6 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 10 Oct 2023 11:52:26 +0200 Subject: [PATCH] Bug 27249: Fix code style Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- Koha/Exceptions/Calendar.pm | 2 +- circ/circulation.pl | 64 +++++++++++++++++++------------------ 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/Koha/Exceptions/Calendar.pm b/Koha/Exceptions/Calendar.pm index 3891c3bced..cdb632a195 100644 --- a/Koha/Exceptions/Calendar.pm +++ b/Koha/Exceptions/Calendar.pm @@ -9,7 +9,7 @@ use Exception::Class ( isa => 'Koha::Exception', }, 'Koha::Exceptions::Calendar::NoOpenDays' => { - isa => 'Koha::Exceptions::Calendar', + isa => 'Koha::Exceptions::Calendar', description => 'Library has no open days', }, ); diff --git a/circ/circulation.pl b/circ/circulation.pl index de416ff7a7..372c5596a9 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -290,36 +290,36 @@ if ($patron) { # # if (@$barcodes) { - my $checkout_infos; - for my $barcode ( @$barcodes ) { - - my $template_params = { - barcode => $barcode, - onsite_checkout => $onsite_checkout, - }; - - # always check for blockers on issuing - my ( $error, $question, $alerts, $messages ); - try { - ( $error, $question, $alerts, $messages ) = CanBookBeIssued( - $patron, - $barcode, $datedue, - $inprocess, - undef, - { - onsite_checkout => $onsite_checkout, - override_high_holds => $override_high_holds || $override_high_holds_tmp || 0, - } - ); - } catch { - die $_ unless blessed $_ && $_->can('rethrow'); + my $checkout_infos; + for my $barcode ( @$barcodes ) { + + my $template_params = { + barcode => $barcode, + onsite_checkout => $onsite_checkout, + }; + + # always check for blockers on issuing + my ( $error, $question, $alerts, $messages ); + try { + ( $error, $question, $alerts, $messages ) = CanBookBeIssued( + $patron, + $barcode, $datedue, + $inprocess, + undef, + { + onsite_checkout => $onsite_checkout, + override_high_holds => $override_high_holds || $override_high_holds_tmp || 0, + } + ); + } catch { + die $_ unless blessed $_ && $_->can('rethrow'); - if ($_->isa('Koha::Exceptions::Calendar::NoOpenDays')) { - $error = { NO_OPEN_DAYS => 1 }; - } else { - $_->rethrow; - } - }; + if ( $_->isa('Koha::Exceptions::Calendar::NoOpenDays') ) { + $error = { NO_OPEN_DAYS => 1 }; + } else { + $_->rethrow; + } + }; my $blocker = $invalidduedate ? 1 : 0; @@ -365,8 +365,10 @@ if (@$barcodes) { # Only some errors will block when performing forced onsite checkout, # for other cases all errors will block - my @blocking_error_codes = ($onsite_checkout and C4::Context->preference("OnSiteCheckoutsForce")) ? - qw( UNKNOWN_BARCODE NO_OPEN_DAYS ) : (keys %$error); + my @blocking_error_codes = + ( $onsite_checkout and C4::Context->preference("OnSiteCheckoutsForce") ) + ? qw( UNKNOWN_BARCODE NO_OPEN_DAYS ) + : ( keys %$error ); foreach my $code ( @blocking_error_codes ) { if ($error->{$code}) { -- 2.39.5