Bugzilla – Attachment 131863 Details for
Bug 29486
_koha_marc_update_bib_ids no longer needed for GetMarcBiblio
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29486: Add check in search_for_data_inconsistencies.pl
Bug-29486-Add-check-in-searchfordatainconsistencie.patch (text/plain), 4.00 KB, created by
Marcel de Rooy
on 2022-03-18 09:31:06 UTC
(
hide
)
Description:
Bug 29486: Add check in search_for_data_inconsistencies.pl
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-03-18 09:31:06 UTC
Size:
4.00 KB
patch
obsolete
>From 41f5fd02b2b0271e51e30f43bb1fcb3b9db24f10 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 19 Jan 2022 14:40:14 +0100 >Subject: [PATCH] Bug 29486: Add check in search_for_data_inconsistencies.pl >Content-Type: text/plain; charset=utf-8 > >If the MARC record does not contain the correct biblionumber of >biblioitemnumber, the script will display the following warning: > >== Bibliographic records have MARCXML without biblionumber or biblioitemnumber == > * Biblionumber 4242 has '1' in 999$c > * Biblionumber 4242 has biblioitemnumber '4242' but should be '1' in 999$d >=> The bibliographic records must have the biblionumber and biblioitemnumber in MARCXML > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../search_for_data_inconsistencies.pl | 55 ++++++++++++++++++- > 1 file changed, 52 insertions(+), 3 deletions(-) > >diff --git a/misc/maintenance/search_for_data_inconsistencies.pl b/misc/maintenance/search_for_data_inconsistencies.pl >index 22b0889549..96b15f3264 100755 >--- a/misc/maintenance/search_for_data_inconsistencies.pl >+++ b/misc/maintenance/search_for_data_inconsistencies.pl >@@ -118,17 +118,66 @@ use C4::Biblio qw( GetMarcFromKohaField ); > } > } > >- my @decoding_errors; >+ my ( @decoding_errors, @ids_not_in_marc ); > my $biblios = Koha::Biblios->search; >+ my ( $biblio_tag, $biblio_subfield ) = C4::Biblio::GetMarcFromKohaField( "biblio.biblionumber" ); >+ my ( $biblioitem_tag, $biblioitem_subfield ) = C4::Biblio::GetMarcFromKohaField( "biblioitems.biblioitemnumber" ); > while ( my $biblio = $biblios->next ) { >- eval{$biblio->metadata->record;}; >- push @decoding_errors, $@ if $@; >+ my $record = eval{$biblio->metadata->record;}; >+ if ($@) { >+ push @decoding_errors, $@; >+ next; >+ } >+ my $biblionumber = $record->subfield($biblio_tag, $biblio_subfield); >+ my $biblioitemnumber = $record->subfield($biblioitem_tag, $biblioitem_subfield); >+ if ( $biblionumber != $biblio->biblionumber ) { >+ push @ids_not_in_marc, >+ { >+ biblionumber => $biblio->biblionumber, >+ biblionumber_in_marc => $biblionumber, >+ }; >+ } >+ if ( $biblioitemnumber != $biblio->biblioitem->biblioitemnumber ) { >+ push @ids_not_in_marc, >+ { >+ biblionumber => $biblio->biblionumber, >+ biblioitemnumber => $biblio->biblioitem->biblioitemnumber, >+ biblioitemnumber_in_marc => $biblionumber, >+ }; >+ } > } > if ( @decoding_errors ) { > new_section("Bibliographic records have invalid MARCXML"); > new_item($_) for @decoding_errors; > new_hint("The bibliographic records must have a valid MARCXML or you will face encoding issues or wrong displays"); > } >+ if (@ids_not_in_marc) { >+ new_section("Bibliographic records have MARCXML without biblionumber or biblioitemnumber"); >+ for my $id (@ids_not_in_marc) { >+ if ( exists $id->{biblioitemnumber} ) { >+ new_item( >+ sprintf(q{Biblionumber %s has biblioitemnumber '%s' but should be '%s' in %s$%s}, >+ $id->{biblionumber}, >+ $id->{biblioitemnumber}, >+ $id->{biblioitemnumber_in_marc}, >+ $biblioitem_tag, >+ $biblioitem_subfield, >+ ) >+ ); >+ } >+ else { >+ new_item( >+ sprintf(q{Biblionumber %s has '%s' in %s$%s}, >+ $id->{biblionumber}, >+ $id->{biblionumber_in_marc}, >+ $biblio_tag, >+ $biblio_subfield, >+ ) >+ ); >+ } >+ } >+ new_hint("The bibliographic records must have the biblionumber and biblioitemnumber in MARCXML"); >+ } > } > > { >-- >2.20.1
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 29486
:
127682
|
129608
|
129609
|
129610
|
131861
|
131862
|
131863
|
131865
|
131866
|
131867