From c805939edacc89baf341bae4d9a9251f4e49a589 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 fc43133e73..04da4eae68 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.2