View | Details | Raw Unified | Return to bug 39413
Collapse All | Expand All

(-)a/misc/maintenance/search_for_data_inconsistencies.pl (-1 / +26 lines)
Lines 128-133 use C4::Biblio qw( GetMarcFromKohaField ); Link Here
128
        }
128
        }
129
    }
129
    }
130
130
131
    my @item_fields_in_marc;
132
    my ( $item_tag, $item_subfield ) = C4::Biblio::GetMarcFromKohaField("items.itemnumber");
133
    my $search_string                     = q{ExtractValue(metadata,'count(//datafield[@tag="} . $item_tag . q{"])')>0};
134
    my $biblio_metadatas_with_item_fields = Koha::Biblio::Metadatas->search( \$search_string );
135
    if ( $biblio_metadatas_with_item_fields->count ) {
136
        while ( my $biblio_metadata_with_item_fields = $biblio_metadatas_with_item_fields->next ) {
137
            push @item_fields_in_marc,
138
                {
139
                biblionumber => $biblio_metadata_with_item_fields->biblionumber,
140
                };
141
        }
142
    }
143
131
    my ( @decoding_errors, @ids_not_in_marc );
144
    my ( @decoding_errors, @ids_not_in_marc );
132
    my $biblios = Koha::Biblios->search;
145
    my $biblios = Koha::Biblios->search;
133
    my ( $biblio_tag,     $biblio_subfield )     = C4::Biblio::GetMarcFromKohaField("biblio.biblionumber");
146
    my ( $biblio_tag,     $biblio_subfield )     = C4::Biblio::GetMarcFromKohaField("biblio.biblionumber");
Lines 201-206 use C4::Biblio qw( GetMarcFromKohaField ); Link Here
201
        }
214
        }
202
        new_hint("The bibliographic records must have the biblionumber and biblioitemnumber in MARCXML");
215
        new_hint("The bibliographic records must have the biblionumber and biblioitemnumber in MARCXML");
203
    }
216
    }
217
    if (@item_fields_in_marc) {
218
        new_section("Bibliographic records have item fields in the MARC");
219
        for my $biblionumber (@item_fields_in_marc) {
220
            new_item(
221
                sprintf(
222
                    q{Biblionumber %s has item fields (%s) in the marc record},
223
                    $biblionumber->{biblionumber},
224
                    $item_tag,
225
                )
226
            );
227
        }
228
        new_hint("You can fix these by running misc/maintenance/touch_all_biblios.pl");
229
    }
204
}
230
}
205
231
206
{
232
{
207
- 

Return to bug 39413