Bugzilla – Attachment 135268 Details for
Bug 28152
Hidden error when importing an item with an existing itemnumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28152: Log the "duplicate item barcode" error
Bug-28152-Log-the-duplicate-item-barcode-error.patch (text/plain), 3.41 KB, created by
Nick Clemens (kidclamp)
on 2022-05-23 14:02:32 UTC
(
hide
)
Description:
Bug 28152: Log the "duplicate item barcode" error
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-05-23 14:02:32 UTC
Size:
3.41 KB
patch
obsolete
>From 6f35f83c80c94d7f41e8f5a6c06c465b87264ae1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 10 Jan 2022 11:22:54 +0100 >Subject: [PATCH] Bug 28152: Log the "duplicate item barcode" error >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Looking at the code this 'import_error' column is empty for the last 9 years. Not sure it makes much sense to have this single error now. > >commit 1dba9c6409d78cb1f90de6c1300cb5b63fb1b851 >Date: Wed Oct 10 14:21:22 2012 -0500 > Bug 7131: teach MARC import how to overlay items > >Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/ImportBatch.pm | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) > >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index e17c1a07e2..6a8fc526f2 100644 >--- a/C4/ImportBatch.pm >+++ b/C4/ImportBatch.pm >@@ -770,13 +770,14 @@ sub BatchCommitItems { > my $duplicate_barcode = exists( $item->{'barcode'} ) && Koha::Items->find({ barcode => $item->{'barcode'} }); > my $duplicate_itemnumber = exists( $item->{'itemnumber'} ); > >- my $updsth = $dbh->prepare("UPDATE import_items SET status = ?, itemnumber = ? WHERE import_items_id = ?"); >+ my $updsth = $dbh->prepare("UPDATE import_items SET status = ?, itemnumber = ?, import_error = ? WHERE import_items_id = ?"); > if ( $action eq "replace" && $duplicate_itemnumber ) { > # Duplicate itemnumbers have precedence, that way we can update barcodes by overlaying > ModItemFromMarc( $item_marc, $biblionumber, $item->{itemnumber} ); > $updsth->bind_param( 1, 'imported' ); > $updsth->bind_param( 2, $item->{itemnumber} ); >- $updsth->bind_param( 3, $row->{'import_items_id'} ); >+ $updsth->bind_param( 3, undef ); >+ $updsth->bind_param( 4, $row->{'import_items_id'} ); > $updsth->execute(); > $updsth->finish(); > $num_items_replaced++; >@@ -785,14 +786,16 @@ sub BatchCommitItems { > ModItemFromMarc( $item_marc, $biblionumber, $itemnumber ); > $updsth->bind_param( 1, 'imported' ); > $updsth->bind_param( 2, $item->{itemnumber} ); >- $updsth->bind_param( 3, $row->{'import_items_id'} ); >+ $updsth->bind_param( 3, undef ); >+ $updsth->bind_param( 4, $row->{'import_items_id'} ); > $updsth->execute(); > $updsth->finish(); > $num_items_replaced++; > } elsif ($duplicate_barcode) { > $updsth->bind_param( 1, 'error' ); > $updsth->bind_param( 2, undef ); >- $updsth->bind_param( 3, $row->{'import_items_id'} ); >+ $updsth->bind_param( 3, 'duplicate item barcode' ); >+ $updsth->bind_param( 4, $row->{'import_items_id'} ); > $updsth->execute(); > $num_items_errored++; > } else { >@@ -804,7 +807,8 @@ sub BatchCommitItems { > if( $itemnumber ) { > $updsth->bind_param( 1, 'imported' ); > $updsth->bind_param( 2, $itemnumber ); >- $updsth->bind_param( 3, $row->{'import_items_id'} ); >+ $updsth->bind_param( 3, undef ); >+ $updsth->bind_param( 4, $row->{'import_items_id'} ); > $updsth->execute(); > $updsth->finish(); > $num_items_added++; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28152
:
119609
|
129243
|
135070
|
135253
|
135254
|
135267
|
135268
|
135294
|
135295