Bugzilla – Attachment 138051 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: (QA follow-up) Use plain SQL in db_rev
Bug-31086-QA-follow-up-Use-plain-SQL-in-dbrev.patch (text/plain), 2.00 KB, created by
Tomás Cohen Arazi
on 2022-07-22 17:38:17 UTC
(
hide
)
Description:
Bug 31086: (QA follow-up) Use plain SQL in db_rev
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2022-07-22 17:38:17 UTC
Size:
2.00 KB
patch
obsolete
>From 999b11e98a1bd9462796428648d818c9e60f2f3a Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 22 Jul 2022 14:36:39 -0300 >Subject: [PATCH] Bug 31086: (QA follow-up) Use plain SQL in db_rev > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > ...o_not_allow_null_branchcode_in_reserves.pl | 19 +++++++++++++++---- > 1 file changed, 15 insertions(+), 4 deletions(-) > >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 4e9c88c4baa..dd6df1f9a5d 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 >@@ -8,11 +8,22 @@ 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 ){ >+ my $sth = $dbh->prepare(q{ >+ SELECT borrowernumber, biblionumber >+ FROM reserves >+ WHERE branchcode IS NULL; >+ }); >+ $sth->execute; >+ my $holds_no_branch = $sth->fetchall_arrayref( {} ); >+ >+ if ( scalar @{$holds_no_branch} > 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"; >+ foreach my $hnb ( @{$holds_no_branch} ) { >+ say $out "Please review hold for borrowernumber " >+ . $hnb->{borrowernumber} >+ . " on biblionumber " >+ . $hnb->{biblionumber} >+ . " to correct pickup branch if necessary"; > } > } > >-- >2.34.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