From 3dc9ca7edd9259286a1ec29d83423ee035ec864a Mon Sep 17 00:00:00 2001 From: Axel Amghar Date: Fri, 12 Apr 2019 11:17:33 +0200 Subject: [PATCH] Bug 22632: Add logging of merged patrons without this patch , when patrons are merged , you can't see the merge in the log viewer. To test: -Apply the patch -Make sure you have "BorrowersLog" on in you System Preference -Search patrons -Check two ore more patrons -Merge selected patrons -Merge patrons -Go to log viewer - Make sure there is the line with the action : "Merge" Signed-off-by: Andrew Fuerste Henry Signed-off-by: Nick Clemens --- Koha/Patron.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index cfa570e0f00..60d92c93f0a 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -792,6 +792,18 @@ sub merge_with { $patron->move_to_deleted(); $patron->delete(); + + if ( C4::Context->preference("BorrowersLog") ) { + my $info = + $patron->firstname . " " + . $patron->surname . " (" + . $patron->cardnumber . ")" + . " has been merged into " + . $self->firstname . " " + . $self->surname . " (" + . $self->cardnumber . ")"; + logaction( "MEMBERS", "Merge", $self->id, $info ); + } } } ); -- 2.39.5