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 <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Frédéric Demians 2022-07-11 12:05:54 +02:00 committed by Tomas Cohen Arazi
parent e7bb0d2a5e
commit d5e65dd4c0
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 1 additions and 0 deletions

View File

@ -610,6 +610,7 @@ sub UpdateOAISetsBiblio {
return unless($biblionumber and $record);
$record = $record->clone;
if (C4::Context->preference('OAI-PMH:AutoUpdateSetsEmbedItemData')) {
$record = Koha::Biblio::Metadata->record(
{