]> git.koha-community.org Git - koha.git/commit
Bug 34828: Add Koha::Biblio::Metadata::Extractor::MARC
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 5 Oct 2023 07:44:42 +0000 (09:44 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 9 Oct 2023 19:41:31 +0000 (16:41 -0300)
commitd5d2f319df686302b0c3281c9f02024f39a5b1e9
treeef5a77a00af80a7da845035938a45fb87b35071c
parent7efeeda29dddaa14447420b1649c1bfce36e5ed9
Bug 34828: Add Koha::Biblio::Metadata::Extractor::MARC

and inherit from it

The new usage is now:

1. With a Koha::Biblio object
my $extractor = Koha::Biblio::Metadata::Extractor->new({biblio => $biblio});
$extractor->get_normalized_upc;

or

2. With a MARC::Record
my $extractor = Koha::Biblio::Metadata::Extractor->new({metadata=> $biblio->metadata->record});
$extractor->get_normalized_upc;

Note that there are "Inconsistent hierarchy during C3 merge of class"
warnings raised by the QA script. We could remove them by replacing the
'use' by 'require' in Koha::Biblio::Metadata::Extractor::MARC (in ->new)
but that's suboptimal.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/Biblio.pm
Koha/Biblio/Metadata/Extractor.pm
Koha/Biblio/Metadata/Extractor/MARC.pm [new file with mode: 0644]
Koha/Biblio/Metadata/Extractor/MARC/MARC21.pm
Koha/Biblio/Metadata/Extractor/MARC/UNIMARC.pm
t/Koha/MetadataExtractor.t [deleted file]
t/Koha/MetadataExtractor/MARC/MARC21.t [deleted file]
t/Koha/MetadataExtractor/MARC/UNIMARC.t [deleted file]
t/db_dependent/Koha/Biblio/Metadata/Extractor/MARC/MARC21.t [new file with mode: 0755]
t/db_dependent/Koha/Biblio/Metadata/Extractor/MARC/UNIMARC.t [new file with mode: 0755]