From f771aea9a4ec3903806871cdbc765d835cdca0d5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 15 Apr 2021 12:12:23 +0200 Subject: [PATCH] Bug 28152: Fix import_items row creation if duplicate barcode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We are trying to insert "duplicate item barcode" into import_items.itemnumber (integer), it fails with "Incorrect integer value: 'duplicate item barcode' for column 'itemnumber' at row 1" To reproduce: Export a biblio with an item Import it => The item is not added, and there is no new row in import_items. The error only appears in the log if you comment the close STDERR and close STDOUT lines Signed-off-by: Joonas Kylmälä Signed-off-by: Nick Clemens --- C4/ImportBatch.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm index 845caa3b58..e17c1a07e2 100644 --- a/C4/ImportBatch.pm +++ b/C4/ImportBatch.pm @@ -791,7 +791,7 @@ sub BatchCommitItems { $num_items_replaced++; } elsif ($duplicate_barcode) { $updsth->bind_param( 1, 'error' ); - $updsth->bind_param( 2, 'duplicate item barcode' ); + $updsth->bind_param( 2, undef ); $updsth->bind_param( 3, $row->{'import_items_id'} ); $updsth->execute(); $num_items_errored++; -- 2.30.2