Bug 33958: Koha::Biblio::normalized_oclc

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-06-08 14:15:16 +02:00 committed by Tomas Cohen Arazi
parent 69841b192a
commit 3fb6dc40fe
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 17 additions and 1 deletions

View File

@ -669,6 +669,8 @@ sub GetNormalizedOCLCNumber {
my ($marcrecord,$marcflavour) = @_;
return unless $marcrecord;
$marcflavour ||= C4::Context->preference('marcflavour');
if ($marcflavour ne 'UNIMARC' ) {
my @fields = $marcrecord->field('035');
foreach my $field (@fields) {

View File

@ -23,7 +23,7 @@ use List::MoreUtils qw( any );
use URI;
use URI::Escape qw( uri_escape_utf8 );
use C4::Koha qw( GetNormalizedISBN GetNormalizedUPC );
use C4::Koha qw( GetNormalizedISBN GetNormalizedUPC GetNormalizedOCLCNumber );
use Koha::Database;
use Koha::DateUtils qw( dt_from_string );
@ -1294,6 +1294,20 @@ sub normalized_upc {
return C4::Koha::GetNormalizedUPC($marc_record);
}
=head3 normalized_oclc
my $normalized_oclc = $biblio->normalized_oclc
Normalizes and returns the OCLC number found in the MARC record.
=cut
sub normalized_oclc {
my ( $self ) = @_;
my $marc_record = $self->metadata->record;
return C4::Koha::GetNormalizedOCLCNumber( $marc_record );
}
=head3 to_api
my $json = $biblio->to_api;