From c6ce4f6fc8f4e0177193366dcbf11a79af2aef4e Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 9 Sep 2020 13:33:17 +0000 Subject: [PATCH] Bug 26364: Remove false matches on isbn The test here was returning 0590353403 when searched for 9780590353403 because of the regex matching Koha doesn't work this way unless SearchWithISBNVariations is set to 'search' and you use a dropdown to select ISBN for searching To test: 1 - Search catalog for nb=9780590353403 2 - Confirm you don't have results, or delete the records with results 3 - Add isbn 0590353403 to a record 4 - Repeat search, fails 5 - Enable SearchWithISBNVariations 6 - Repeat search, fails 7 - Go to advanced search, select ISBN, search for 9780590353403 8 - Get results Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart (cherry picked from commit 854d404a9c161845731d39980165f8d641713a80) Signed-off-by: Fridolin Somers --- t/db_dependent/XISBN.t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/XISBN.t b/t/db_dependent/XISBN.t index 61ab80f58a..a9825e942f 100755 --- a/t/db_dependent/XISBN.t +++ b/t/db_dependent/XISBN.t @@ -108,13 +108,13 @@ sub Mock_simple_search_compat { $query =~ s/-//g; my $ret_biblionumber; - if ( $query =~ /$isbn1/ ) { + if ( $query eq "nb=$isbn1" ) { $ret_biblionumber = $biblionumber1; } - elsif ( $query =~ /$isbn2/ ) { + elsif ( $query eq "nb=$isbn2" ) { $ret_biblionumber = $biblionumber2; } - elsif ( $query =~ /$isbn3/ ) { + elsif ( $query eq "nb=$isbn3" ) { $ret_biblionumber = $biblionumber3; } -- 2.20.1