Bug 27249: Fix code style

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4b4028d783)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Julian Maurice 2023-10-10 11:52:26 +02:00 committed by Fridolin Somers
parent b1feff4228
commit 7cb8e222e4
2 changed files with 32 additions and 30 deletions

View file

@ -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',
},
);

View file

@ -290,36 +290,36 @@ if ($patron) {
#
#
if (@$barcodes) {
my $checkout_infos;
for my $barcode ( @$barcodes ) {
my $checkout_infos;
for my $barcode ( @$barcodes ) {
my $template_params = {
barcode => $barcode,
onsite_checkout => $onsite_checkout,
};
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,
# 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;
}
);
} catch {
die $_ unless blessed $_ && $_->can('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}) {