fix for bug 1499 - normalize ISBN before dupe check
authorGalen Charlton <galen.charlton@liblime.com>
Tue, 16 Oct 2007 21:02:37 +0000 (16:02 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 17 Oct 2007 12:10:07 +0000 (07:10 -0500)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Search.pm

index 49bc72a..3242634 100644 (file)
@@ -101,6 +101,11 @@ sub FindDuplicate {
     my ( $biblionumber, $title );
 
     # search duplicate on ISBN, easy and fast..
+    # ... normalize first
+    if ( $result->{isbn} ) {
+        $result->{isbn} =~ s/\(.*$//;
+        $result->{isbn} =~ s/\s+$//; 
+    }
     #$search->{'avoidquerylog'}=1;
     if ( $result->{isbn} ) {
         $query = "isbn=$result->{isbn}";