Bugzilla – Attachment 170648 Details for
Bug 37550
bulkmarcimport.pl dies when adding items throws an exception
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37550: Move item check after error handling
Bug-37550-Move-item-check-after-error-handling.patch (text/plain), 1.71 KB, created by
Phil Ringnalda
on 2024-08-23 15:38:36 UTC
(
hide
)
Description:
Bug 37550: Move item check after error handling
Filename:
MIME Type:
Creator:
Phil Ringnalda
Created:
2024-08-23 15:38:36 UTC
Size:
1.71 KB
patch
obsolete
>From 6028156decc1962c92ad0ec13893957d3c2f3256 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 1 Aug 2024 17:37:35 +0000 >Subject: [PATCH] Bug 37550: Move item check after error handling > >To test: >1 - Grab the sample file on this bug report >2 - perl misc/migration_tools/bulkmarcimport.pl -b --file=spaceditems.pl -v >3 - An exception for 'Duplicate ID' is thrown and script dies >4 - Apply patch >5 - run script again >6 - The script finishes, no items are added, but record is > >Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> >--- > misc/migration_tools/bulkmarcimport.pl | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl >index 8161a0bb0a..9c1f144af3 100755 >--- a/misc/migration_tools/bulkmarcimport.pl >+++ b/misc/migration_tools/bulkmarcimport.pl >@@ -597,7 +597,6 @@ RECORD: foreach my $record ( @{$marc_records} ) { > AddItemBatchFromMarc( $record, $record_id, $biblioitemnumber, $framework ); > }; > my $error_adding = $@; >- $record_has_added_items = @{$itemnumbers_ref}; > > if ($error_adding) { > warn "ERROR: Adding items to bib $record_id failed: $error_adding"; >@@ -607,6 +606,9 @@ RECORD: foreach my $record ( @{$marc_records} ) { > # the MARC columns in biblioitems were not set. > next RECORD; > } >+ >+ $record_has_added_items = @{$itemnumbers_ref}; >+ > if ( $dedup_barcode && grep { exists $_->{error_code} && $_->{error_code} eq 'duplicate_barcode' } > @$errors_ref ) > { >-- >2.44.0
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 37550
:
169959
|
169960
|
169961
|
170630
|
170648
|
170649
|
170650
|
173868
|
173869
|
173870