Bugzilla – Attachment 152153 Details for
Bug 33955
Add Koha::Biblio->normalized_upc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33955: Koha::Biblio::normalized_upc
Bug-33955-KohaBiblionormalizedupc.patch (text/plain), 1.59 KB, created by
Jonathan Druart
on 2023-06-08 10:56:55 UTC
(
hide
)
Description:
Bug 33955: Koha::Biblio::normalized_upc
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-06-08 10:56:55 UTC
Size:
1.59 KB
patch
obsolete
>From 3b18d8696e61d46c2dae2a4f1640e4de95136ce3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 8 Jun 2023 11:47:03 +0200 >Subject: [PATCH] Bug 33955: Koha::Biblio::normalized_upc > >--- > 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 7132910adf0..c98665f2fad 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -581,6 +581,8 @@ sub display_marc_indicators { > sub GetNormalizedUPC { > my ($marcrecord,$marcflavour) = @_; > >+ $marcflavour ||= C4::Context->preference('marcflavour'); >+ > return unless $marcrecord; > if ($marcflavour eq 'UNIMARC') { > my @fields = $marcrecord->field('072'); >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 0d120b85c2c..7641ec0678d 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 ); >+use C4::Koha qw( GetNormalizedISBN GetNormalizedUPC ); > > use Koha::Database; > use Koha::DateUtils qw( dt_from_string ); >@@ -1244,6 +1244,20 @@ sub normalized_isbn { > return C4::Koha::GetNormalizedISBN($self->biblioitem->isbn); > } > >+=head3 normalized_upc >+ >+ my $normalized_upc = $biblio->normalized_upc >+ >+Normalizes and returns the UPC value found in the MARC record. >+ >+=cut >+ >+sub normalized_upc { >+ my ( $self ) = @_; >+ my $marc_record = $self->metadata->record; >+ return C4::Koha::GetNormalizedUPC( $marc_record ); >+} >+ > =head3 to_api > > my $json = $biblio->to_api; >-- >2.25.1
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 33955
:
152152
|
152153
|
155542
|
155543
|
155699
|
155700
|
155819