LP 1198465: Have bill_payment_map_for_xact create its own CStoreEditor if necessary.
authorJason Stephenson <jason@sigio.com>
Tue, 7 Jan 2014 17:27:17 +0000 (12:27 -0500)
committerJason Stephenson <jason@sigio.com>
Thu, 20 Feb 2014 22:56:36 +0000 (17:56 -0500)
Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm

index 9416770..261e391 100644 (file)
@@ -361,6 +361,11 @@ sub can_close_circ {
 sub bill_payment_map_for_xact {
     my ($class, $e, $xact) = @_;
 
+    # Check for CStoreEditor and make a new one if we have to. This
+    # allows one-off calls to this subroutine to pass undef as the
+    # CStoreEditor and not have to create one of their own.
+    $e = OpenILS::Utils::CStoreEditor->new; unless ($e);
+
     # find all bills in order
     my $bill_search = [
         {xact => $xact->id()},