From f0c36157ef13ad7a8f4238128cb145d94b9c9504 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 20 Jan 2016 08:45:48 +0000 Subject: [PATCH] Bug 15607: batch patron mod - do not update dates if not given Bug 15332 fixed a bug but introduced a bigger one. Even if dateenrolled and dateexpiry are not modified, they will be updated to today. Indeed, dt_from_string returns today without parameters. Test plan: - Set dateenrolled and expirydate for a patron - Using the batch patron mod tool, update any field but dateenrolled and expirydate. => Without this patch, the 2 date fields should be set to today => With this patch applied, the 2 date fields should not have been modified. Signed-off-by: Karam Qubsi Signed-off-by: Katrin Fischer Signed-off-by: Jesse Weaver (cherry picked from commit 2505a3d840c15e51c7967a576d53a416b5f92bfb) Signed-off-by: Julian Maurice --- tools/modborrowers.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl index f88581fbd2..95d26de398 100755 --- a/tools/modborrowers.pl +++ b/tools/modborrowers.pl @@ -266,7 +266,7 @@ if ( $op eq 'do' ) { } for my $field ( qw( dateenrolled dateexpiry ) ) { - $infos->{$field} = dt_from_string($infos->{$field}); + $infos->{$field} = dt_from_string($infos->{$field}) if $infos->{$field}; } my @attributes = $input->param('patron_attributes'); -- 2.39.5