From 38f644bb1f8bf820f36b1479cd74bf9a537e6e9c Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 8 Sep 2016 12:06:05 +0200 Subject: [PATCH] Bug 6852: Preliminary test Content-Type: text/plain; charset=utf-8 --- C4/ImportBatch.pm | 14 ++++++++------ C4/Items.pm | 3 +++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm index 046b859..2ecd96b 100644 --- a/C4/ImportBatch.pm +++ b/C4/ImportBatch.pm @@ -792,12 +792,14 @@ sub BatchCommitItems { $num_items_errored++; } else { my ( $item_biblionumber, $biblioitemnumber, $itemnumber ) = AddItemFromMarc( $item_marc, $biblionumber ); - $updsth->bind_param( 1, 'imported' ); - $updsth->bind_param( 2, $itemnumber ); - $updsth->bind_param( 3, $row->{'import_items_id'} ); - $updsth->execute(); - $updsth->finish(); - $num_items_added++; + if( $itemnumber ) { + $updsth->bind_param( 1, 'imported' ); + $updsth->bind_param( 2, $itemnumber ); + $updsth->bind_param( 3, $row->{'import_items_id'} ); + $updsth->execute(); + $updsth->finish(); + $num_items_added++; + } } } diff --git a/C4/Items.pm b/C4/Items.pm index 2f31897..d379989 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -309,6 +309,9 @@ sub AddItem { } my ( $itemnumber, $error ) = _koha_new_item( $item, $item->{barcode} ); + if( $error ) { + return; + } $item->{'itemnumber'} = $itemnumber; ModZebra( $item->{biblionumber}, "specialUpdate", "biblioserver" ); -- 1.7.10.4