From 4715e06812a2a5583b570db15e9ee702d8fb050f 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 --- 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 0689273df5..c8e64e0938 100755 --- a/t/db_dependent/XISBN.t +++ b/t/db_dependent/XISBN.t @@ -104,13 +104,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.11.0