[Koha-patches] [PATCH] Bug 16870 - Update Koha::Patron use of the class

Srdjan srdjan at catalyst.net.nz
Fri Jul 15 04:22:26 CEST 2016


From: Kyle M Hall <kyle at bywatersolutions.com>

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Patron/Borrower_PrevCheckout.t
3) prove t/db_dependent/Koha/Checkouts.t

Signed-off-by: Srdjan <srdjan at catalyst.net.nz>
---
 Koha/Patron.pm | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/Koha/Patron.pm b/Koha/Patron.pm
index 5ba5efc..37a1d85 100644
--- a/Koha/Patron.pm
+++ b/Koha/Patron.pm
@@ -24,7 +24,7 @@ use Carp;
 
 use C4::Context;
 use Koha::Database;
-use Koha::Issues;
+use Koha::Checkouts;
 use Koha::OldIssues;
 use Koha::Patron::Categories;
 use Koha::Patron::Images;
@@ -153,19 +153,19 @@ sub do_check_for_previous_checkout {
         push @item_nos, $item->itemnumber;
     }
 
-    # Create (old)issues search criteria
+    # Create (old)checkouts search criteria
     my $criteria = {
         borrowernumber => $self->borrowernumber,
         itemnumber => \@item_nos,
     };
 
-    # Check current issues table
-    my $issues = Koha::Issues->search($criteria);
-    return 1 if $issues->count; # 0 || N
+    # Check current checkouts table
+    my $checkouts = Koha::Checkouts->search($criteria);
+    return 1 if $checkouts->count; # 0 || N
 
-    # Check old issues table
-    my $old_issues = Koha::OldIssues->search($criteria);
-    return $old_issues->count;  # 0 || N
+    # Check old checkouts table
+    my $old_checkouts = Koha::OldIssues->search($criteria);
+    return $old_checkouts->count;  # 0 || N
 }
 
 =head3 type
-- 
2.7.4


More information about the Koha-patches mailing list