@@ -, +, @@ starting with 978 --------- -- note that test 17 has been changed. --- C4/Koha.pm | 4 ++-- t/Koha.t | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/C4/Koha.pm +++ a/C4/Koha.pm @@ -1720,12 +1720,12 @@ sub NormalizeISBN { if ( $isbn && $isbn->is_valid() ) { if ( $format eq 'ISBN-10' ) { - $isbn = $isbn->as_isbn10(); + my $isbn10 = $isbn->as_isbn10(); + $isbn = $isbn10 if $isbn10; } elsif ( $format eq 'ISBN-13' ) { $isbn = $isbn->as_isbn13(); } - return unless $isbn; if ($strip_hyphens) { $string = $isbn->as_string( [] ); --- a/t/Koha.t +++ a/t/Koha.t @@ -93,7 +93,7 @@ eval { $isbn = C4::Koha::NormalizeISBN({ isbn => '979-10-90085-00-8', format => 'ISBN-10', strip_hyphens => 1 }); }; ok($@ eq '', 'NormalizeISBN does not throw exception when converting to ISBN10 an ISBN starting with 979 (bug 13167)'); -ok(!defined $isbn, 'NormalizeISBN returns undef when converting to ISBN10 an ISBN starting with 979 (bug 13167)'); +ok($isbn eq '9791090085008', 'NormalizeISBN returns ISBN13 when converting to ISBN10 an ISBN starting with 979 (bug 14287)'); @isbns = GetVariationsOfISBNs('abc'); is(scalar(@isbns), 0, 'zero variations returned of invalid ISBN'); --