Bug 18276: (follow-up) Remove GetBiblioFromItemNumber - Easy ones
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 10 Jul 2017 15:54:35 +0000 (12:54 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 10 Jul 2017 16:02:54 +0000 (13:02 -0300)
- Item does not have a title attribute, it comes from biblio
- There is an additional call to effective_itemtype done on AddReturn,
so we need to catch both warnings

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Circulation.pm
t/db_dependent/Circulation/Returns.t

index 69ac19a..069bb80 100644 (file)
@@ -2877,7 +2877,7 @@ sub AddRenewal {
                     VALUES (now(),?,?,?,?,?,?,?,?)"
         );
         $sth->execute( $borrowernumber, $accountno, $charge, $manager_id,
-            "Renewal of Rental Item " . $item_object->title . " $item->{'barcode'}",
+            "Renewal of Rental Item " . $biblio->title . " $item->{'barcode'}",
             'Rent', $charge, $itemnumber );
     }
 
index 19e6313..e8d52af 100644 (file)
@@ -175,7 +175,8 @@ subtest "AddReturn logging on statistics table (item-level_itypes=1)" => sub {
     is( $stat->itemtype, $ilevel_itemtype,
         "item-level itype recorded on statistics for return");
     warning_like { AddIssue( $borrower, $item_without_itemtype->{ barcode } ) }
-                 qr/^item-level_itypes set but no itemtype set for item/,
+                 [qr/^item-level_itypes set but no itemtype set for item/,
+                 qr/^item-level_itypes set but no itemtype set for item/],
                  'Item without itemtype set raises warning on AddIssue';
     warning_like { AddReturn( $item_without_itemtype->{ barcode }, $branch ) }
                  qr/^item-level_itypes set but no itemtype set for item/,