Bugzilla – Attachment 39930 Details for
Bug 14287
Preserve valid ISBN-13 identifiers if they start with something else than 978
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14287: counter-patch to preserve valid ISBN-13 not starting with 978
Bug-14287-counter-patch-to-preserve-valid-ISBN-13-.patch (text/plain), 1.98 KB, created by
Mark Tompsett
on 2015-06-06 00:36:58 UTC
(
hide
)
Description:
Bug 14287: counter-patch to preserve valid ISBN-13 not starting with 978
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2015-06-06 00:36:58 UTC
Size:
1.98 KB
patch
obsolete
>From 70794ed26c46ecc17fa9a48931abb2eedc0d3c7b Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Fri, 5 Jun 2015 20:31:51 -0400 >Subject: [PATCH] Bug 14287: counter-patch to preserve valid ISBN-13 not > starting with 978 > >Since the issue is for ISBN-13 to ISBN-10 of non-978 ISBN-13 values, >this patch only modifies the ISBN-10 case. Additionally, since >ISBN-13 always returns a value, this patch means the return unless >is no longer needed. Flooding the error log seems unnecessary. > >TEST PLAN >--------- >1) prove -v t/Koha.t >2) apply patch >3) prove -v t/Koha.t > -- note that test 17 has been changed. >4) run koha qa test tools >--- > C4/Koha.pm | 4 ++-- > t/Koha.t | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 4f54a3b..a6f7d23 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -1720,12 +1720,12 @@ sub NormalizeISBN { > if ( $isbn && $isbn->is_valid() ) { > > if ( $format eq 'ISBN-10' ) { >- $isbn = $isbn->as_isbn10(); >+ my $isbn10 = $isbn->as_isbn10(); >+ $isbn = $isbn10 if $isbn10; > } > elsif ( $format eq 'ISBN-13' ) { > $isbn = $isbn->as_isbn13(); > } >- return unless $isbn; > > if ($strip_hyphens) { > $string = $isbn->as_string( [] ); >diff --git a/t/Koha.t b/t/Koha.t >index 933fd5b..2482b0d 100755 >--- a/t/Koha.t >+++ b/t/Koha.t >@@ -93,7 +93,7 @@ eval { > $isbn = C4::Koha::NormalizeISBN({ isbn => '979-10-90085-00-8', format => 'ISBN-10', strip_hyphens => 1 }); > }; > ok($@ eq '', 'NormalizeISBN does not throw exception when converting to ISBN10 an ISBN starting with 979 (bug 13167)'); >-ok(!defined $isbn, 'NormalizeISBN returns undef when converting to ISBN10 an ISBN starting with 979 (bug 13167)'); >+ok($isbn eq '9791090085008', 'NormalizeISBN returns ISBN13 when converting to ISBN10 an ISBN starting with 979 (bug 14287)'); > > @isbns = GetVariationsOfISBNs('abc'); > is(scalar(@isbns), 0, 'zero variations returned of invalid ISBN'); >-- >2.1.4
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 14287
:
39625
|
39930
|
40126