From bdc718f8f590a06e686a7e62415d997a0c8e5f2b Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 10 Aug 2017 15:20:58 +0000 Subject: [PATCH] Bug 19076 - Move issue logging in AddIssue into condtional clause Currently AddIssue tests if renewal, but logs an issue even if so. This patch moves the logging into the conditional so a log entry is only added if we aren't renewing (as renewals are logged separately) To test: 1 - prove t/db_dependent/Circulation.t - one test should fail 2 - Enable both issue and renewal logs 3 - Checkout an item to a patron 4 - View the logs - the issue is captured 5 - Checkout the item to the patron again and confirm renewal 6 - Both an issue and a renewal are logged 7 - Apply patch 8 Repeat 1-6, tests should pass and only renewal should be logged Signed-off-by: Julian Maurice --- C4/Circulation.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index fba723f7f8..0c1163b02f 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1451,13 +1451,12 @@ sub AddIssue { } ); } + logaction( + "CIRCULATION", "ISSUE", + $borrower->{'borrowernumber'}, + $item->{'itemnumber'} + ) if C4::Context->preference("IssueLog"); } - - logaction( - "CIRCULATION", "ISSUE", - $borrower->{'borrowernumber'}, - $item->{'itemnumber'} - ) if C4::Context->preference("IssueLog"); } return $issue; } -- 2.11.0