From 95e9ae46bd862a939316b2bf298cb75cd7d30859 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 16 Sep 2024 10:43:13 +0200 Subject: [PATCH] Bug 37902: Do not convert a date if it has like markers If we pass a datetime parameter we are adding "like" operator and % at the beginning and ending of the attribute value. For instance: attributes=2024-09-16 10:11:12 attributes:{ like => '%2024-09-16 10:11:12%' } We do not want to reach the fixup code and raise an exception. However I don't think we should add the like for datetime attributes actually. But can we modify this behaviour now? Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer --- Koha/Object.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Object.pm b/Koha/Object.pm index 63efcdd68f..d57a6ee26a 100644 --- a/Koha/Object.pm +++ b/Koha/Object.pm @@ -851,7 +851,7 @@ sub _recursive_fixup { # Handle booleans gracefully $value = ($value) ? 1 : 0; } elsif ( _date_or_datetime_column_type( $column_info->{data_type} ) ) { - if ( defined $value ) { + if ( defined $value && $value !~ m{^%|%$} ) { try { my $dtf = $self->_result->result_source->storage->datetime_parser; if ( $column_info->{data_type} eq 'date' ) { -- 2.39.5