Bugzilla – Attachment 138018 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: Notify of problematic holds during upgrade
Bug-31086-Notify-of-problematic-holds-during-upgra.patch (text/plain), 1.80 KB, created by
Nick Clemens (kidclamp)
on 2022-07-22 12:32:16 UTC
(
hide
)
Description:
Bug 31086: Notify of problematic holds during upgrade
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-07-22 12:32:16 UTC
Size:
1.80 KB
patch
obsolete
>From b677680590c4434b7314b226ed390695b355eff2 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 22 Jul 2022 12:31:55 +0000 >Subject: [PATCH] Bug 31086: Notify of problematic holds during upgrade > >--- > ..._31086_do_not_allow_null_branchcode_in_reserves.pl | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_31086_do_not_allow_null_branchcode_in_reserves.pl b/installer/data/mysql/atomicupdate/bug_31086_do_not_allow_null_branchcode_in_reserves.pl >index ea2c1a6eb4..4e9c88c4ba 100755 >--- a/installer/data/mysql/atomicupdate/bug_31086_do_not_allow_null_branchcode_in_reserves.pl >+++ b/installer/data/mysql/atomicupdate/bug_31086_do_not_allow_null_branchcode_in_reserves.pl >@@ -1,4 +1,5 @@ > use Modern::Perl; >+use Koha::Holds; > > return { > bug_number => "31086", >@@ -7,9 +8,17 @@ return { > my ($args) = @_; > my ($dbh, $out) = @$args{qw(dbh out)}; > >+ my $holds_no_branch = Koha::Holds->search({ branchcode => undef }); >+ if( $holds_no_branch->count > 0 ){ >+ say $out "Holds with no branchcode were found and will be updated to the first branch in the system"; >+ while ( my $hnb = $holds_no_branch->next ){ >+ say $out "Please review hold for borrowernumber " . $hnb->borrowernumber . " on biblionumber " . $hnb->biblionumber . " to correct pickup branch if necessary"; >+ } >+ } >+ > # Ensure we have no NULL's in the branchcode field > $dbh->do(q{ >- UPDATE reserves SET branchcode = ( SELECT branchcode FROM branches LIMIT 1) WHERE branchode IS NULL; >+ UPDATE reserves SET branchcode = ( SELECT branchcode FROM branches LIMIT 1) WHERE branchcode IS NULL; > }); > > # Set the NOT NULL configuration >-- >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 31086
:
136983
|
136984
|
136986
|
136987
|
137026
|
137254
|
137255
|
137256
|
137257
|
137258
|
137635
|
137636
|
137637
|
137638
|
137639
|
137640
|
137641
|
137642
|
138006
| 138018 |
138051
|
144824