If formatted dates are sent to DBIx::Class on update/insert, the date
will be set as 0000-00-00 (except if the format is yyyy-mm-dd).
Test plan:
Use the batch patron modification tools to update the dateenrolled or
dateexpiry values for at least 1 patron.
Without this patch, the modified value will be updated to 0000-00-00,
with this patch, the correct value will be set.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
use C4::Members::AttributeTypes qw/GetAttributeTypes_hashref/;
use C4::Output;
use List::MoreUtils qw /any uniq/;
+use Koha::DateUtils qw( dt_from_string );
use Koha::List::Patron;
my $input = new CGI;
$infos->{$field} = "" if grep { /^$field$/ } @disabled;
}
+ for my $field ( qw( dateenrolled dateexpiry ) ) {
+ $infos->{$field} = dt_from_string($infos->{$field});
+ }
+
my @attributes = $input->param('patron_attributes');
my @attr_values = $input->param('patron_attributes_value');