Bugzilla – Attachment 150180 Details for
Bug 33603
misc/maintenance/search_for_data_inconsistencies.pl fails if biblio.biblionumber on control field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33603: Fix misc/maintenance/search_for_data_inconsistencies.pl when biblio.biblionumber on control field
Bug-33603-Fix-miscmaintenancesearchfordatainconsis.patch (text/plain), 2.38 KB, created by
Fridolin Somers
on 2023-04-25 06:10:59 UTC
(
hide
)
Description:
Bug 33603: Fix misc/maintenance/search_for_data_inconsistencies.pl when biblio.biblionumber on control field
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2023-04-25 06:10:59 UTC
Size:
2.38 KB
patch
obsolete
>From 2580298f4a9c5e00f05e2d74dec65a98880d0052 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Mon, 24 Apr 2023 20:05:50 -1000 >Subject: [PATCH] Bug 33603: Fix > misc/maintenance/search_for_data_inconsistencies.pl when biblio.biblionumber > on control field > >Since bug 29486, misc/maintenance/search_for_data_inconsistencies.pl search for biblio.biblionumber in MARC record with $record->subfield(). >This fails when field is a control field (< 10). >Idem for biblioitems.biblioitemnumber > >Test plan : >1.0) On a UNIMARC database (biblio.biblionumber is on 001) >1.1) Run misc/maintenance/search_for_data_inconsistencies.pl >=> Without patch you get error : Control fields (generally, just tags below 010) do not have subfields, use data() >=> With patch no error >2.0) On a MARC21 database (biblio.biblionumber is on 999c) >2.1) Run misc/maintenance/search_for_data_inconsistencies.pl >=> Check you see no error >--- > .../search_for_data_inconsistencies.pl | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > >diff --git a/misc/maintenance/search_for_data_inconsistencies.pl b/misc/maintenance/search_for_data_inconsistencies.pl >index 7e1befef92..98f69215cd 100755 >--- a/misc/maintenance/search_for_data_inconsistencies.pl >+++ b/misc/maintenance/search_for_data_inconsistencies.pl >@@ -129,8 +129,19 @@ use C4::Biblio qw( GetMarcFromKohaField ); > push @decoding_errors, $@; > next; > } >- my $biblionumber = $record->subfield($biblio_tag, $biblio_subfield); >- my $biblioitemnumber = $record->subfield($biblioitem_tag, $biblioitem_subfield); >+ my ( $biblionumber, $biblioitemnumber ); >+ if ( $biblio_tag < 10 ) { >+ my $biblio_control_field = $record->field($biblio_tag); >+ $biblionumber = $biblio_control_field->data if $biblio_control_field; >+ } else { >+ $biblionumber = $record->subfield( $biblio_tag, $biblio_subfield ); >+ } >+ if ( $biblioitem_tag < 10 ) { >+ my $biblioitem_control_field = $record->field($biblioitem_tag); >+ $biblioitemnumber = $biblioitem_control_field->data if $biblioitem_control_field; >+ } else { >+ $biblioitemnumber = $record->subfield( $biblioitem_tag, $biblioitem_subfield ); >+ } > if ( $biblionumber != $biblio->biblionumber ) { > push @ids_not_in_marc, > { >-- >2.39.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 33603
:
150180
|
150181
|
150190