From e5d97a001d3b70d1a2e436fd490c2820f448784f 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=utf8 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 Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi (cherry picked from commit c7a8a456c7dcc0bc2a015968f7a2c0e9ac2370f0) Signed-off-by: Lucas Gass --- 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.39.5