[Koha-patches] [PATCH 2/2] Bug 11912: GetMarcISBN wrongly prepends a space to ISBNs
Tomas Cohen Arazi
tomascohen at gmail.com
Sun Mar 9 22:47:07 CET 2014
This patch makes the logic inside GetMarcISBN simpler and
fixes the issue.
To test:
- Run the regression tests:
prove -v t/db_dependent/Biblio.t
=> FAIL
- Apply the patch
- Run:
prove -v t/db_dependent/Biblio.t
=> SUCCESS
- Verify that opac-detail.pl and catalogue/detail.pl look as usual regarding ISBN
- Sign off
Regards
To+
Sponsored-by: Universidad Nacional de Cordoba
---
C4/Biblio.pm | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/C4/Biblio.pm b/C4/Biblio.pm
index 330951d..a34e5b6 100644
--- a/C4/Biblio.pm
+++ b/C4/Biblio.pm
@@ -1690,25 +1690,15 @@ sub GetMarcISBN {
$scope = '020';
}
my @marcisbns;
- my $isbn = "";
- my $tag = "";
my $marcisbn;
foreach my $field ( $record->field($scope) ) {
- my $value = $field->as_string();
+ my $isbn = $field->as_string();
if ( $isbn ne "" ) {
$marcisbn = { marcisbn => $isbn, };
push @marcisbns, $marcisbn;
- $isbn = $value;
- }
- if ( $isbn ne $value ) {
- $isbn = $isbn . " " . $value;
}
}
- if ($isbn) {
- $marcisbn = { marcisbn => $isbn };
- push @marcisbns, $marcisbn; #load last tag into array
- }
return \@marcisbns;
} # end GetMarcISBN
--
1.8.3.2
More information about the Koha-patches
mailing list