From b66b86402cd84026f7dabaa2e567a1956b9bbe86 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 Signed-off-by: Jonathan Druart --- C4/Circulation.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 32b95c109e..75c3814823 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1452,13 +1452,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.39.5