Bugzilla – Attachment 160490 Details for
Bug 25539
Remove AddBiblio "defer_marc_save" option
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25539: Strip items when adding new biblio to preserve previous behaviour of the script
Bug-25539-Strip-items-when-adding-new-biblio-to-pr.patch (text/plain), 2.16 KB, created by
Martin Renvoize (ashimema)
on 2024-01-03 16:38:07 UTC
(
hide
)
Description:
Bug 25539: Strip items when adding new biblio to preserve previous behaviour of the script
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-01-03 16:38:07 UTC
Size:
2.16 KB
patch
obsolete
>From c910df3e49252b56848d0896c65cd513584f0fd4 Mon Sep 17 00:00:00 2001 >From: David Gustafsson <glasklas@gmail.com> >Date: Fri, 12 Nov 2021 23:42:30 +0100 >Subject: [PATCH] Bug 25539: Strip items when adding new biblio to preserve > previous behaviour of the script >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: MichaĆ Kula <148193449+mkibp@users.noreply.github.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > misc/migration_tools/bulkmarcimport.pl | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > >diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl >index 9166f4d0df9..082fcfeff1d 100755 >--- a/misc/migration_tools/bulkmarcimport.pl >+++ b/misc/migration_tools/bulkmarcimport.pl >@@ -546,7 +546,9 @@ RECORD: foreach my $record (@{$marc_records}) { > } > } > elsif ($insert) { >- eval { ($record_id, $biblioitemnumber) = AddBiblio($record, $framework, $add_biblio_options) }; >+ my $record_clone = $record->clone(); >+ C4::Biblio::_strip_item_fields($record_clone); >+ eval { ($record_id, $biblioitemnumber) = AddBiblio($record_clone, $framework, $add_biblio_options) }; > if ($@) { > warn "ERROR: Insert biblio $originalid failed: $@\n"; > printlog( { id => $originalid, op => "insert", status => "ERROR" } ) if ($logfile); >@@ -555,6 +557,11 @@ RECORD: foreach my $record (@{$marc_records}) { > else { > printlog( { id => $originalid, op => "insert", status => "ok" } ) if ($logfile); > } >+ # If incoming record has bib ids set we need to transfer >+ # new ids from record_clone to incoming record to avoid >+ # working on wrong record (the original record) later on >+ # when adding items for example >+ C4::Biblio::_koha_marc_update_bib_ids($record, $framework, $record_id, $biblioitemnumber); > } > else { > warn "WARNING: Insert biblio $originalid skipped"; >-- >2.43.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 25539
:
105065
|
105066
|
109789
|
110260
|
110261
|
127599
|
127600
|
127601
|
127602
|
127603
|
127976
|
127977
|
127978
|
127979
|
127980
|
127981
|
133030
|
133031
|
133032
|
133034
|
133035
|
133036
|
140992
|
140993
|
140994
|
156224
|
156225
|
156226
|
160158
|
160159
|
160160
|
160489
| 160490 |
160491