From cada676ef3439d2567fa21da415d939f0fc22ee6 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Thu, 5 Dec 2013 15:34:44 +0100 Subject: [PATCH] Bug 6331: (follow-up) update timestamp when deleting items When item is transfered from items table to deleted items, all fields must be copies but "timestamp". This value must be updated to know when the item was deleted. Test plan: - Look a an item timestamp : mysql> select timestamp from items where itemnumber = 2690; +---------------------+ | timestamp | +---------------------+ | 2011-09-09 15:30:21 | +---------------------+ 1 row in set (0.00 sec) - Delete this item in cataloguing module - Check it is not in items table anymore : mysql> select timestamp from items where itemnumber = 2690; Empty set (0.00 sec) - Look in deleteditems table : mysql> select timestamp from deleteditems where itemnumber = 2690; +---------------------+ | timestamp | +---------------------+ | 2013-12-05 15:33:20 | +---------------------+ 1 row in set (0.00 sec) => timestamp as been set to actual date/time Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Patch set passes koha-qa.pl, works as advertised! Signed-off-by: Galen Charlton --- C4/Items.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/Items.pm b/C4/Items.pm index 068291bc9e..4c1a4ad286 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -2336,6 +2336,7 @@ sub _koha_delete_item { my $query = "INSERT INTO deleteditems SET "; my @bind = (); foreach my $key ( keys %$data ) { + next if ( $key eq 'timestamp' ); # timestamp will be set by db $query .= "$key = ?,"; push( @bind, $data->{$key} ); } -- 2.39.5