Bug 28152: Fix import_items row creation if duplicate barcode

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ä <joonas.kylmala@iki.fi>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c7a8a456c7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e5d97a001d)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
This commit is contained in:
Jonathan Druart 2021-04-15 12:12:23 +02:00 committed by Arthur Suzuki
parent f8d11504b7
commit fc4139d5aa
1 changed files with 1 additions and 1 deletions

View File

@ -790,7 +790,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++;