Bugzilla – Attachment 28233 Details for
Bug 12243
Records with invalid ISBNs can cause searches to fail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12243 - Records with invalid ISBNs can cause searches to fail
Bug-12243---Records-with-invalid-ISBNs-can-cause-s.patch (text/plain), 1.51 KB, created by
Chris Cormack
on 2014-05-14 07:36:40 UTC
(
hide
)
Description:
Bug 12243 - Records with invalid ISBNs can cause searches to fail
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2014-05-14 07:36:40 UTC
Size:
1.51 KB
patch
obsolete
>From 3cb2f4895dbc4fd28381e40f4b8e82030efc5893 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 13 May 2014 07:20:39 -0400 >Subject: [PATCH] Bug 12243 - Records with invalid ISBNs can cause searches to > fail > >Some types of invalid ISBNs, when run throught C4::Koha::NormalizeISBN >can produce ISBN objects that contain invalid ISBNs. This can be >reproduced with an ISBN that has an invalid prefix, group code or >publisher code. An example ISBN would be "0788893777 (2 DVD 45th ed)". > >When attempting to look up a record with such an ISBN, you will get an >error along the lines of: Can't call method "as_string" on an undefined >value > >Instead of checking for the BAD_ISBN state, we should be checking for >the GOOD_ISBN state vi the method is_valid. > >Test Plan: >1) Edit a record, add the following ISBN to your record: 0788893777 (2 DVD 45th ed) >2) When Koha redirects to the record, you should see the error message described >3) Apply this patch >4) Reload the page, you should now see your record > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > C4/Koha.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 5988249..1061a78 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -1595,7 +1595,7 @@ sub NormalizeISBN { > > my $isbn = Business::ISBN->new($string); > >- if ( $isbn && $isbn->error != Business::ISBN::BAD_ISBN ) { >+ if ( $isbn && $isbn->is_valid() ) { > > if ( $format eq 'ISBN-10' ) { > $isbn = $isbn->as_isbn10(); >-- >1.9.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 12243
:
28203
|
28233
|
28244