From 367216fd2ddcb7f8ac06641a140579d9d48b9dfe 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 --- Koha/Object.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/Object.pm b/Koha/Object.pm index 63efcdd68fa..d57a6ee26ae 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