From 57fcd4884eaee2637c3a3ad0cbe3af3b5b0c49fc Mon Sep 17 00:00:00 2001 From: Frederic Demians Date: Fri, 26 Sep 2008 19:25:58 +0200 Subject: [PATCH] Bugfix #2630 2nd attempt Signed-off-by: Galen Charlton --- C4/Search.pm | 6 +++--- opac/opac-detail.pl | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 8e0a6b0521..05aff805b7 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -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 diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 314dbe0a49..e08a0f55f9 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -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)){ -- 2.39.5