Bugzilla – Attachment 2737 Details for
Bug 4305
Amazon book covers do not work with ISBN13
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Further Patch
0001-Bug-4305-Improve-code-flow.patch (text/plain), 1.28 KB, created by
Colin Campbell
on 2010-11-11 14:05:29 UTC
(
hide
)
Description:
Further Patch
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2010-11-11 14:05:29 UTC
Size:
1.28 KB
patch
obsolete
>From e3b749b3cdcd8cbeef981540c15ee9ffac8043e4 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Thu, 11 Nov 2010 13:18:14 +0000 >Subject: [PATCH] Bug 4305 Improve code flow >Content-Type: text/plain; charset="utf-8" > >Use the ISBN Object's method to format the string >rather than add extra code to do it >Clean up the code flow for clarity >Benchmarking shows its a bit faster too >Don't add to the number of Test::Perl::Critic warnings > for no benefit >--- > C4/Koha.pm | 17 +++++++++-------- > 1 files changed, 9 insertions(+), 8 deletions(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index e746f83..a63a3a5 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -1350,14 +1350,15 @@ sub _normalize_match_point { > return $normalized_match_point; > } > >-sub _isbn_cleanup ($) { >- my $isbn = Business::ISBN->new( shift ); >- return undef unless $isbn; >- $isbn = $isbn->as_isbn10 if $isbn->type eq 'ISBN13'; >- return undef unless $isbn; >- $isbn = $isbn->as_string; >- $isbn =~ s/-//g; >- return $isbn; >+sub _isbn_cleanup { >+ my $isbn = Business::ISBN->new( $_[0] ); >+ if ( $isbn ) { >+ $isbn = $isbn->as_isbn10 if $isbn->type eq 'ISBN13'; >+ if (defined $isbn) { >+ return $isbn->as_string([]); >+ } >+ } >+ return; > } > > 1; >-- >1.7.3.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 4305
:
2669
|
2670
|
2695
| 2737