Bug 33952: Koha::Biblio->normalized_isbn

This is needed for bug 33947 where we need to call ->normalized_isbn on a Koha::Biblio object.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.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 10:55:36 +02:00 committed by Tomas Cohen Arazi
parent 3c52e63f78
commit 9d59d0d308
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -979,7 +979,7 @@ sub custom_cover_image_url {
$url =~ s|{isbn}|$isbn|g;
}
if ( $url =~ m|{normalized_isbn}| ) {
my $normalized_isbn = C4::Koha::GetNormalizedISBN($self->biblioitem->isbn);
my $normalized_isbn = $self->normalized_isbn;
return unless $normalized_isbn;
$url =~ s|{normalized_isbn}|$normalized_isbn|g;
}
@ -1249,6 +1249,19 @@ sub get_marc_authors {
return [@first_authors, @other_authors];
}
=head3 normalized_isbn
my $normalized_isbn = $biblio->normalized_isbn
Normalizes and returns the first valid ISBN found in the record.
ISBN13 are converted into ISBN10. This is required to get some book cover images.
=cut
sub normalized_isbn {
my ( $self) = @_;
return C4::Koha::GetNormalizedISBN($self->biblioitem->isbn);
}
=head3 to_api