Bugzilla – Attachment 38348 Details for
Bug 14046
CheckIfIssuedToPatron fails if biblionumber != biblioitemnumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 14046: Make the CheckIfIssuedToPatron using the biblionumber
PASSED-QA-Bug-14046-Make-the-CheckIfIssuedToPatron.patch (text/plain), 1.64 KB, created by
Kyle M Hall (khall)
on 2015-04-22 15:33:10 UTC
(
hide
)
Description:
[PASSED QA] Bug 14046: Make the CheckIfIssuedToPatron using the biblionumber
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-04-22 15:33:10 UTC
Size:
1.64 KB
patch
obsolete
>From f3329577dac354fb968b331623a329689f8e7bd0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 22 Apr 2015 16:05:41 +0200 >Subject: [PATCH] [PASSED QA] Bug 14046: Make the CheckIfIssuedToPatron using the biblionumber > >C4::Circ::CheckIfIssuedToPatron called > $items = GetItemsByBiblioitemnumber($biblionumber); >But if biblionumber != biblioitemnumber, the items retrieved were not >the good ones! > >Test plan: >Make your Auto increment values for biblio and biblioitems differs >Launch the tests: > prove t/db_dependent/Circulation/CheckIfIssuedToPatron.t > >Before this patch, they did not pass. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Circulation.pm | 15 +++++++++------ > 1 files changed, 9 insertions(+), 6 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index bd192cf..dd23734 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3808,12 +3808,15 @@ sub TransferSlip { > sub CheckIfIssuedToPatron { > my ($borrowernumber, $biblionumber) = @_; > >- my $items = GetItemsByBiblioitemnumber($biblionumber); >- >- foreach my $item (@{$items}) { >- return 1 if ($item->{borrowernumber} && $item->{borrowernumber} eq $borrowernumber); >- } >- >+ my $dbh = C4::Context->dbh; >+ my $query = q| >+ SELECT COUNT(*) FROM issues >+ LEFT JOIN items ON items.itemnumber = issues.itemnumber >+ WHERE items.biblionumber = ? >+ AND issues.borrowernumber = ? >+ |; >+ my $is_issued = $dbh->selectrow_array($query, {}, $biblionumber, $borrowernumber ); >+ return 1 if $is_issued; > return; > } > >-- >1.7.2.5
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 14046
:
38341
|
38342
| 38348