Bugzilla – Attachment 150190 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.48 KB, created by
Nick Clemens (kidclamp)
on 2023-04-25 11:58:51 UTC
(
hide
)
Description:
Bug 33603: Fix misc/maintenance/search_for_data_inconsistencies.pl when biblio.biblionumber on control field
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-04-25 11:58:51 UTC
Size:
2.48 KB
patch
obsolete
>From 46f6e4fa05e9c291908f55dc331662635b206a77 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 > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../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.30.2
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