From 073fd8ccaa50303fc1a310308122cbccc54ea446 Mon Sep 17 00:00:00 2001
From: Kyle M Hall <kyle@bywatersolutions.com>
Date: Wed, 20 May 2020 07:26:25 -0400
Subject: [PATCH] Bug 15985: Fix QA script issues

* Use original base for old checkout objects
* test rs for results before returning a patron object
---
 Koha/Checkout.pm      | 1 +
 Koha/Old/Checkout.pm  | 3 ++-
 Koha/Old/Checkouts.pm | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Koha/Checkout.pm b/Koha/Checkout.pm
index a6640bf27c..c961202a12 100644
--- a/Koha/Checkout.pm
+++ b/Koha/Checkout.pm
@@ -89,6 +89,7 @@ Return the patron for who the checkout has been done
 sub patron {
     my ( $self ) = @_;
     my $patron_rs = $self->_result->borrower;
+    return unless $patron_rs;
     return Koha::Patron->_new_from_dbic( $patron_rs );
 }
 
diff --git a/Koha/Old/Checkout.pm b/Koha/Old/Checkout.pm
index e6c58d53a7..cf6d9a9b22 100644
--- a/Koha/Old/Checkout.pm
+++ b/Koha/Old/Checkout.pm
@@ -20,7 +20,7 @@ use Modern::Perl;
 use Koha::Database;
 use Koha::DateUtils qw(dt_from_string);
 
-use base qw(Koha::Checkout);
+use base qw(Koha::Object);
 
 =head1 NAME
 
@@ -55,6 +55,7 @@ Return the patron for who the checkout has been done
 sub patron {
     my ( $self ) = @_;
     my $patron_rs = $self->_result->borrower;
+    return unless $patron_rs;
     return Koha::Patron->_new_from_dbic( $patron_rs );
 }
 
diff --git a/Koha/Old/Checkouts.pm b/Koha/Old/Checkouts.pm
index ed961428cc..af598efab1 100644
--- a/Koha/Old/Checkouts.pm
+++ b/Koha/Old/Checkouts.pm
@@ -20,7 +20,7 @@ use Modern::Perl;
 use Koha::Database;
 use Koha::Old::Checkout;
 
-use base qw(Koha::Checkouts);
+use base qw(Koha::Objects);
 
 sub _type {
     return 'OldIssue';
-- 
2.24.2 (Apple Git-127)