From 6d9c1403fbaf2e9784bd4774d41df4e07249022e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 14 Oct 2022 11:04:40 +0200 Subject: [PATCH] Bug 31437: (bug 30718 follow-up) Prevent useless indexation call from ModDateLastSeen Koha::Object->store is triggering an UPDATE because the datelastseen is different than the value in DB (comparing a datetime with a date) Signed-off-by: Tomas Cohen Arazi --- C4/Items.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Items.pm b/C4/Items.pm index a34527d51d..9d443bb6ec 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -400,7 +400,7 @@ sub ModDateLastSeen { my ( $itemnumber, $leave_item_lost, $params ) = @_; my $item = Koha::Items->find($itemnumber); - $item->datelastseen(dt_from_string); + $item->datelastseen(dt_from_string->ymd); my $log = $item->itemlost && !$leave_item_lost ? 1 : 0; # If item was lost, record the change to the item $item->itemlost(0) unless $leave_item_lost; $item->store({ log_action => $log, skip_record_index => $params->{skip_record_index}, skip_holds_queue => $params->{skip_holds_queue} }); -- 2.39.5