Bugzilla – Attachment 182268 Details for
Bug 39413
Add a check for item fields in bibliographic MARC records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39413: Add a check for item fields in MARC records to data inconsistencies script
Bug-39413-Add-a-check-for-item-fields-in-MARC-reco.patch (text/plain), 2.87 KB, created by
Martin Renvoize (ashimema)
on 2025-05-12 12:42:24 UTC
(
hide
)
Description:
Bug 39413: Add a check for item fields in MARC records to data inconsistencies script
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-05-12 12:42:24 UTC
Size:
2.87 KB
patch
obsolete
>From 8f8f2d1074fae9e7672388cc6fa73aa478d9729e Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 21 Mar 2025 16:35:15 +0000 >Subject: [PATCH] Bug 39413: Add a check for item fields in MARC records to > data inconsistencies script > >This patch adds a new test to the data inconsistencies script to report where >MARC records contain item fields. > >These may not cause issues in Koha, however, in discovery harvests they have eben found to create errors > >To test: >1 - Follow test plan on bug 39412 to generate records with item tags >2 - perl misc/maintenance/search_for_data_inconsistencies.pl >3 - Note new section and hint on how to fix >4 - perl misc/maintenance/touch_all_biblios.pl >5 - repeat 2 >6 - Errors cleared > >Signed-off-by: Magnus Enger <magnus@libriotech.no> >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > .../search_for_data_inconsistencies.pl | 26 +++++++++++++++++++ > 1 file changed, 26 insertions(+) > >diff --git a/misc/maintenance/search_for_data_inconsistencies.pl b/misc/maintenance/search_for_data_inconsistencies.pl >index ebe3204ed3e..72d96561188 100755 >--- a/misc/maintenance/search_for_data_inconsistencies.pl >+++ b/misc/maintenance/search_for_data_inconsistencies.pl >@@ -128,6 +128,19 @@ use C4::Biblio qw( GetMarcFromKohaField ); > } > } > >+ my @item_fields_in_marc; >+ my ( $item_tag, $item_subfield ) = C4::Biblio::GetMarcFromKohaField("items.itemnumber"); >+ my $search_string = q{ExtractValue(metadata,'count(//datafield[@tag="} . $item_tag . q{"])')>0}; >+ my $biblio_metadatas_with_item_fields = Koha::Biblio::Metadatas->search( \$search_string ); >+ if ( $biblio_metadatas_with_item_fields->count ) { >+ while ( my $biblio_metadata_with_item_fields = $biblio_metadatas_with_item_fields->next ) { >+ push @item_fields_in_marc, >+ { >+ biblionumber => $biblio_metadata_with_item_fields->biblionumber, >+ }; >+ } >+ } >+ > my ( @decoding_errors, @ids_not_in_marc ); > my $biblios = Koha::Biblios->search; > my ( $biblio_tag, $biblio_subfield ) = C4::Biblio::GetMarcFromKohaField("biblio.biblionumber"); >@@ -201,6 +214,19 @@ use C4::Biblio qw( GetMarcFromKohaField ); > } > new_hint("The bibliographic records must have the biblionumber and biblioitemnumber in MARCXML"); > } >+ if (@item_fields_in_marc) { >+ new_section("Bibliographic records have item fields in the MARC"); >+ for my $biblionumber (@item_fields_in_marc) { >+ new_item( >+ sprintf( >+ q{Biblionumber %s has item fields (%s) in the marc record}, >+ $biblionumber->{biblionumber}, >+ $item_tag, >+ ) >+ ); >+ } >+ new_hint("You can fix these by running misc/maintenance/touch_all_biblios.pl"); >+ } > } > > { >-- >2.49.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 39413
:
179628
|
180204
| 182268