Bug 18382: action_logs entry for module HOLDS, action SUSPEND is spammy

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 <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Kyle M Hall 2017-06-05 10:46:45 -04:00 committed by Jonathan Druart
parent d5afc40805
commit 2deaead256
1 changed files with 5 additions and 2 deletions

View File

@ -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) )