From 4869d7bfae5ce3a3e5d1ee3bdf3bf7380d15ec7e Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 5 Jun 2017 10:46:45 -0400 Subject: [PATCH] Bug 18382: action_logs entry for module HOLDS, action SUSPEND is spammy Content-Type: text/plain; charset=utf-8 When a hold is suspended, 'suspend_until' is represented as a DateTime object, complete with locale. All told, this is about 800 lines of text. Test Plan: 1) Enable the HoldsLog syspref 2) Add a hold on a record/item 3) Suspend the hold with a date to resume 4) Note the massive amount of date in the suspend_until field 5) Apply this patch 6) Suspend another hold with a date to resume 7) Note the log has an acutal date in the suspend_until field Check the logs using module 'Holds' and Action 'Suspend' Signed-off-by: Katrin Fischer Signed-off-by: Marcel de Rooy --- Koha/Hold.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Koha/Hold.pm b/Koha/Hold.pm index 949770d..56780f8 100644 --- a/Koha/Hold.pm +++ b/Koha/Hold.pm @@ -91,8 +91,11 @@ sub suspend_hold { } $self->suspend(1); - $self->suspend_until( $dt ); - + if ( defined $dt ){ + $self->suspend_until( $dt->ymd ); + } else { + $self->suspend_until( $dt ); + } $self->store(); logaction( 'HOLDS', 'SUSPEND', $self->reserve_id, Dumper($self->unblessed) ) -- 2.1.4