Bugfix #2630 2nd attempt
authorFrederic Demians <f.demians@tamil.fr>
Fri, 26 Sep 2008 17:25:58 +0000 (19:25 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Tue, 28 Oct 2008 21:09:32 +0000 (22:09 +0100)
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
C4/Search.pm
opac/opac-detail.pl

index 8e0a6b0..05aff80 100644 (file)
@@ -1266,9 +1266,9 @@ sub searchResults {
 
                my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $oldbiblio->{biblionumber} ) );
                $oldbiblio->{authorised_value_images} = $biblio_authorised_value_images;
-        my $aisbn = $oldbiblio->{'isbn'};
-        $aisbn =~ /(\d*[X]*)/;
-        $oldbiblio->{amazonisbn} = $1;
+        (my $aisbn) = $oldbiblio->{isbn} =~ /([\d-]*[X]*)/;
+        $aisbn =~ s/-//g;
+        $oldbiblio->{amazonisbn} = $aisbn;
                $oldbiblio->{description} = $itemtypes{ $oldbiblio->{itemtype} }->{description};
  # Build summary if there is one (the summary is defined in the itemtypes table)
  # FIXME: is this used anywhere, I think it can be commented out? -- JF
index 314dbe0..e08a0f5 100755 (executable)
@@ -250,8 +250,9 @@ sub isbn_cleanup ($) {
 
 # XISBN Stuff
 my $xisbn=$dat->{'isbn'};
-$xisbn =~ /(\d*[X]*)/;
-$template->param(amazonisbn => $1);            # FIXME: so it is OK if the ISBN = 'XXXXX' ?
+(my $aisbn) = $xisbn =~ /([\d-]*[X]*)/;
+$aisbn =~ s/-//g;
+$template->param(amazonisbn => $aisbn);                # FIXME: so it is OK if the ISBN = 'XXXXX' ?
 my ($clean,$clean2);
 # these might be overkill, but they are better than the regexp above.
 if ($clean = isbn_cleanup($xisbn)){