[Koha-patches] [PATCH] Bugfix bug #2630

Frederic Demians f.demians at tamil.fr
Mon Sep 22 19:49:01 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..fa4b367 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;
+        ($_) = $oldbiblio->{isbn} =~ /([\d-]*[X]*)/;
+        s/-//g;
+        $oldbiblio->{amazonisbn} = $_;
 		$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..6f1dc48 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' ?
+($_) = $xisbn =~ /([\d-]*[X]*)/;
+s/-//g;
+$template->param(amazonisbn => $_);		# 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