Bugzilla – Attachment 155704 Details for
Bug 33958
Add Koha::Biblio->normalized_oclc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33958: Koha::Biblio::normalized_oclc
Bug-33958-KohaBiblionormalizedoclc.patch (text/plain), 1.70 KB, created by
Kyle M Hall (khall)
on 2023-09-15 17:01:52 UTC
(
hide
)
Description:
Bug 33958: Koha::Biblio::normalized_oclc
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-09-15 17:01:52 UTC
Size:
1.70 KB
patch
obsolete
>From b26767d3eefbb8b5562864b3d38eee7499d13187 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 8 Jun 2023 14:15:16 +0200 >Subject: [PATCH] Bug 33958: Koha::Biblio::normalized_oclc > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Koha.pm | 2 ++ > Koha/Biblio.pm | 16 +++++++++++++++- > 2 files changed, 17 insertions(+), 1 deletion(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index c98665f2fad..124d5362a04 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -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) { >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 95c787860a7..a82fc01d127 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -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; >-- >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 33958
:
152175
|
152176
|
155703
|
155704
|
155705
|
156214
|
156215
|
156216