From 0a419dd742ac7f5375e0764a0f0e6594871b8131 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Mon, 11 Jul 2022 12:05:54 +0200 Subject: [PATCH] Bug 30308: Fix bulkmarcimport.pl broken by OAI-PMH:AutoUpdateSets(EmbedItemData) Test plan: (A) Reproduce the bug: A1 In Administration > System preferences > Web services: - Enable OAI-PMH - Enable OAI-PMH:AutoUpdateSets - Enable OAI-PMH:AutoUpdateSetsEmbedItemData A2 In Tools > Export data > Export bibliographic records, export 1 (one) biblio record. Be sure that this biblio record has at least one item. Don't tick "Don't export items". A3 Delete the exported biblio record, and its items. A4 In command line, on the server load the exported file: ./bulkmarcimport.pl -b -v -file /path/to/koha.mrc A5 Retrieve the biblio record in Koha. Note the absence of the item(s). This is the bug. (B) Apply the patch B1 Delete the record (without item) loaded at A4. B2 In command line, on the server load the exported file: ./bulkmarcimport.pl -b -v -file /path/to/koha.mrc B2 Retrieve the biblio record in Koha. Note the presence of the item(s). Signed-off-by: David Nind Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi (cherry picked from commit d5e65dd4c0352c4fb2d96f4cabfc6e6311770cd0) Signed-off-by: Lucas Gass (cherry picked from commit 06b48f16e420ccac12cc0560d0091c404e647be6) Signed-off-by: Arthur Suzuki (cherry picked from commit 084c14787f751e8aabee7db6f701c5d4c71cf497) Signed-off-by: Victor Grousset/tuxayo --- C4/OAI/Sets.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/OAI/Sets.pm b/C4/OAI/Sets.pm index 0ecdc77b7d..76592f5692 100644 --- a/C4/OAI/Sets.pm +++ b/C4/OAI/Sets.pm @@ -609,6 +609,7 @@ sub UpdateOAISetsBiblio { return unless($biblionumber and $record); + $record = $record->clone; if (C4::Context->preference('OAI-PMH:AutoUpdateSetsEmbedItemData')) { C4::Biblio::EmbedItemsInMarcBiblio({ marc_record => $record, -- 2.39.5