[Koha-patches] [PATCH] Bugfix #2630 2nd attempt
Frederic Demians
f.demians at tamil.fr
Fri Sep 26 19:25:58 CEST 2008
---
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 fc43133..04da4ea 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 149209c..16e7bfd 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)){
--
1.5.5.GIT
More information about the Koha-patches
mailing list