From 0d81696d775b80702d0f78ac1821797fbffc8ea8 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 6 Mar 2025 13:27:47 +0000 Subject: [PATCH] Bug 26869: Use the default framework The unit tests highlighted that without passing an frameworkcode to the MarcSubfieldStructures->find call we throw errors as we can't identify the correct subfield structure rules to apply. This patch adds the default frameworkcode, empty string, to the lookup. Signed-off-by: Martin Renvoize --- Koha/BackgroundJob/BatchUpdateBiblio.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Koha/BackgroundJob/BatchUpdateBiblio.pm b/Koha/BackgroundJob/BatchUpdateBiblio.pm index f46565afa84..d33bec61207 100644 --- a/Koha/BackgroundJob/BatchUpdateBiblio.pm +++ b/Koha/BackgroundJob/BatchUpdateBiblio.pm @@ -205,7 +205,8 @@ sub can_add_item_from_marc_record { # Check that holdingbranch is set my $holdingbranch_mss = Koha::MarcSubfieldStructures->find( { - kohafield => 'items.holdingbranch', + frameworkcode => '', + kohafield => 'items.holdingbranch', } ); my @holdingbranch_exists = @@ -215,7 +216,8 @@ sub can_add_item_from_marc_record { # Check that homebranch is set my $homebranch_mss = Koha::MarcSubfieldStructures->find( { - kohafield => 'items.homebranch', + frameworkcode => '', + kohafield => 'items.homebranch', } ); my @homebranch_exists = @@ -225,7 +227,8 @@ sub can_add_item_from_marc_record { # Check that itemtype is set my $item_mss = Koha::MarcSubfieldStructures->find( { - kohafield => C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype', + frameworkcode => '', + kohafield => C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype', } ); my @itemtype_exists = grep { $_->subfield( $item_mss->tagsubfield ) } $record->field( $item_mss->tagfield ); -- 2.48.1