Bugzilla – Attachment 137636 Details for
Bug 31086
Do not allow hold requests with no branchcode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31086: Throw an exception when a hold is stored with no branchcode
Bug-31086-Throw-an-exception-when-a-hold-is-stored.patch (text/plain), 1.79 KB, created by
Martin Renvoize (ashimema)
on 2022-07-12 15:24:46 UTC
(
hide
)
Description:
Bug 31086: Throw an exception when a hold is stored with no branchcode
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-07-12 15:24:46 UTC
Size:
1.79 KB
patch
obsolete
>From e18c5babf35360001ed4334ed69005ad24607164 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 1 Jul 2022 14:44:09 +0000 >Subject: [PATCH] Bug 31086: Throw an exception when a hold is stored with no > branchcode > >To test: >1 - Apply first 2 patches >2 - On staff client, find a biblio, place hold, select a patron >3 - Before creating hold, right click on 'Pickup location' >4 - Inspect the element >5 - In the console find the top <li> for pickup, and right click >6 - Select 'Delete node' >7 - Save hold >8 - You get an exception/error > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Exceptions/Hold.pm | 4 ++++ > Koha/Hold.pm | 2 ++ > 2 files changed, 6 insertions(+) > >diff --git a/Koha/Exceptions/Hold.pm b/Koha/Exceptions/Hold.pm >index 8538963b96..b09dcd65b5 100644 >--- a/Koha/Exceptions/Hold.pm >+++ b/Koha/Exceptions/Hold.pm >@@ -31,6 +31,10 @@ use Exception::Class ( > 'Koha::Exceptions::Hold::InvalidPickupLocation' => { > isa => 'Koha::Exceptions::Hold', > description => 'The supplied pickup location is not valid' >+ }, >+ 'Koha::Exceptions::Hold::MissingPickupLocation' => { >+ isa => 'Koha::Exceptions::Hold', >+ description => 'You must supply a pickup location when placing a hold' > } > ); > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index be5970cbd4..68d0c8581d 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -713,6 +713,8 @@ expirationdate for holds. > sub store { > my ($self) = @_; > >+ Koha::Exceptions::Hold::MissingPickupLocation->throw() unless $self->branchcode; >+ > if ( !$self->in_storage ) { > if ( ! $self->expirationdate && $self->patron_expiration_date ) { > $self->expirationdate($self->patron_expiration_date); >-- >2.20.1
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 31086
:
136983
|
136984
|
136986
|
136987
|
137026
|
137254
|
137255
|
137256
|
137257
|
137258
|
137635
| 137636 |
137637
|
137638
|
137639
|
137640
|
137641
|
137642
|
138006
|
138018
|
138051
|
144824