From eed1447a63b9e3d80fcb8171b5d2bfde3994e554 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 10 Jul 2017 12:54:35 -0300 Subject: [PATCH] Bug 18276: (follow-up) Remove GetBiblioFromItemNumber - Easy ones - 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 --- C4/Circulation.pm | 2 +- t/db_dependent/Circulation/Returns.t | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 69ac19a2d8..069bb80274 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -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 ); } diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t index 19e6313051..e8d52af732 100644 --- a/t/db_dependent/Circulation/Returns.t +++ b/t/db_dependent/Circulation/Returns.t @@ -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/, -- 2.39.5