Bugzilla – Attachment 51177 Details for
Bug 10756
Add carousel/coverflow display of new titles to the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10756 - Carousel Display - Followup
Bug-10756---Carousel-Display---Followup.patch (text/plain), 1.73 KB, created by
Magnus Enger
on 2016-05-04 07:07:08 UTC
(
hide
)
Description:
Bug 10756 - Carousel Display - Followup
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2016-05-04 07:07:08 UTC
Size:
1.73 KB
patch
obsolete
>From bedd35bb2d306882d7afb5ef71f209b1452c748b Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@libriotech.no> >Date: Wed, 4 May 2016 08:31:47 +0200 >Subject: [PATCH] Bug 10756 - Carousel Display - Followup > >On first testing this I got a 500 error saying "Can't call method >"is_valid" on an undefined value at /home/magnus/scripts/kohaclone/Koha/Carousel.pm >line 128." This was caused by a record with an ISBN of "979-10-91414-01-2". >The relevant code looks like this: > my $isbn_obj = Business::ISBN->new($ii); > my $isbn10; > $isbn10 = $isbn_obj->as_isbn10; > if ( $isbn10->is_valid() ) {...} >The documentation for Business::ISBN::as_isbn10 says: "Returns a new >ISBN object. If the object is already ISBN-10, this method clones it. >If it is an ISBN-13 with the prefix 978, it returns the ISBN-10 >equivalent. For all other cases it returns undef." So for an ISBN that >starts with 979 like mine did, $isbn10 will be undef and we need to do >some extra checking before is_valid(). > >To test: >- Apply the first two patches on this bug and follow their test plan >- Make sure you have a new record with an ISBN that starts with 979 >- Refresh the front page and observe the error >- Apply this patch >- Refresh the front page again and notice the absence of the error >--- > Koha/Carousel.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/Carousel.pm b/Koha/Carousel.pm >index ec6a7f7..ba6ac6b 100755 >--- a/Koha/Carousel.pm >+++ b/Koha/Carousel.pm >@@ -125,7 +125,7 @@ sub GetRecentBibs { > > my $isbn10; > $isbn10 = $isbn_obj->as_isbn10; >- if ( $isbn10->is_valid() ) { >+ if ( $isbn10 && $isbn10->is_valid() ) { > $isbn = $isbn10->as_string( [] ); > last; > } >-- >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 10756
:
51173
|
51174
|
51175
|
51176
|
51177
|
51187