Bugzilla – Attachment 154728 Details for
Bug 27249
Using the calendar to 'close' a library can create an infinite loop during renewals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27249: Catch NoOpenDays exception while checking out an item
Bug-27249-Catch-NoOpenDays-exception-while-checkin.patch (text/plain), 3.39 KB, created by
Julian Maurice
on 2023-08-24 07:28:22 UTC
(
hide
)
Description:
Bug 27249: Catch NoOpenDays exception while checking out an item
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2023-08-24 07:28:22 UTC
Size:
3.39 KB
patch
obsolete
>From 7952177b2e7ce9f24a77fb46975a941c8edc5f85 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 24 Aug 2023 09:27:28 +0200 >Subject: [PATCH] Bug 27249: Catch NoOpenDays exception while checking out an > item > >--- > circ/circulation.pl | 34 +++++++++++++------ > .../prog/en/modules/circ/circulation.tt | 4 +++ > 2 files changed, 27 insertions(+), 11 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 9b925e29ad..c947fcd2ca 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -29,7 +29,8 @@ use CGI qw ( -utf8 ); > use URI::Escape qw( uri_escape_utf8 ); > use DateTime; > use DateTime::Duration; >-use Scalar::Util qw( looks_like_number ); >+use Scalar::Util qw( blessed looks_like_number ); >+use Try::Tiny; > use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); > use C4::Auth qw( get_session get_template_and_user ); > use C4::Koha; >@@ -298,16 +299,27 @@ if (@$barcodes) { > }; > > # always check for blockers on issuing >- my ( $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, >+ 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; > } >- ); >+ }; > > my $blocker = $invalidduedate ? 1 : 0; > >@@ -354,7 +366,7 @@ 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 ) : (keys %$error); >+ qw( UNKNOWN_BARCODE NO_OPEN_DAYS ) : (keys %$error); > > foreach my $code ( @blocking_error_codes ) { > if ($error->{$code}) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 4150426c37..eb3fe36a80 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -515,6 +515,10 @@ > [% IF ( RECALLED_INTRANSIT ) %] > <li>Item has been recalled and is in transit for pickup at [% Branches.GetName( RECALLED_INTRANSIT ) | html %].</li> > [% END %] >+ >+ [% IF NO_OPEN_DAYS %] >+ <li>No open days found while calculating the due date. Check the library calendar.</li> >+ [% END %] > </ul> > > [% IF (forceallow) %] >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27249
:
153585
|
153682
|
154728
|
154920
|
154921
|
156786
|
156787
|
156788
|
157163
|
157164
|
157165
|
157166
|
157167