Bugzilla – Attachment 126866 Details for
Bug 29319
Errors when doing a cataloging search which starts with a number + letter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29319: Use Business::ISBN to check ISBNs on addbooks.pl/cataloging search
Bug-29319-Use-BusinessISBN-to-check-ISBNs-on-addbo.patch (text/plain), 1.87 KB, created by
Lucas Gass (lukeg)
on 2021-10-25 22:57:15 UTC
(
hide
)
Description:
Bug 29319: Use Business::ISBN to check ISBNs on addbooks.pl/cataloging search
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2021-10-25 22:57:15 UTC
Size:
1.87 KB
patch
obsolete
>From 79d8511939a3bcfbfc2f91362f9a9f43109a67de Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Mon, 25 Oct 2021 22:52:22 +0000 >Subject: [PATCH] Bug 29319: Use Business::ISBN to check ISBNs on > addbooks.pl/cataloging search > >To test: >1. Go to cataloging search and enter something like "7th Heaven". >2. Get an error when searching, Koha thinks you entered an ISBN >3. Apply patch >4. Try the same search, it should be a proper title search now >5. Find some stuff in the catalog with ISBN numbers in them. >6. The search should properly return ISBN13/ISBN10 searches, without with out the '-'. >--- > cataloguing/addbooks.pl | 17 +++++------------ > 1 file changed, 5 insertions(+), 12 deletions(-) > >diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl >index b9f3d6e719..079d477b15 100755 >--- a/cataloguing/addbooks.pl >+++ b/cataloguing/addbooks.pl >@@ -38,6 +38,7 @@ use Koha::BiblioFrameworks; > use Koha::SearchEngine::Search; > use Koha::SearchEngine::QueryBuilder; > use Koha::Z3950Servers; >+use Business::ISBN; > > my $input = CGI->new; > >@@ -105,19 +106,11 @@ if ($query) { > my $countbr = 0; > my @resultsbr; > if ($query) { >-# fill isbn or title, depending on what has been entered >-#u must do check on isbn because u can find number in beginning of title >-#check is on isbn legnth 13 for new isbn and 10 for old isbn > my ( $title, $isbn ); >- if ($query=~/\d/) { >- my $clean_query = $query; >- $clean_query =~ s/-//g; # remove hyphens >- my $querylength = length $clean_query; >- if ( $querylength == 13 || $querylength == 10 ) { >- $isbn = $query; >- } >- } >- if (!$isbn) { >+ my $isbn_valid = Business::ISBN->new($query); >+ if ( $isbn_valid && $isbn_valid->is_valid() ) { >+ $isbn = $query; >+ } else { > $title = $query; > } > ( $countbr, @resultsbr ) = BreedingSearch( $title, $isbn ); >-- >2.20.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 29319
:
126866
|
126946
|
127128