View | Details | Raw Unified | Return to bug 14629
Collapse All | Expand All

(-)a/C4/Koha.pm (-2 / +5 lines)
Lines 1719-1726 sub GetVariationsOfISSN { Link Here
1719
1719
1720
    my @issns;
1720
    my @issns;
1721
1721
1722
    push( @issns, NormalizeISSN({ issn => $issn }) );
1722
    if( NormalizeISSN({issn => $issn}) ){
1723
    push( @issns, NormalizeISSN({ issn => $issn, strip_hyphen => 1 }) );
1723
        push( @issns, NormalizeISSN({ issn => $issn }) );
1724
        push( @issns, NormalizeISSN({ issn => $issn, strip_hyphen => 1 }) );
1725
    }
1726
    else { push( @issns, $issn) }
1724
1727
1725
    # Strip out any "empty" strings from the array
1728
    # Strip out any "empty" strings from the array
1726
    @issns = grep { defined($_) && $_ =~ /\S/ } @issns;
1729
    @issns = grep { defined($_) && $_ =~ /\S/ } @issns;
(-)a/t/Koha.t (-5 / +2 lines)
Lines 119-125 is( C4::Koha::GetNormalizedISBN('9781250075345 (hardcover) | 1250075343 (hardcov Link Here
119
is( C4::Koha::GetNormalizedISBN('9781250067128 | 125006712X'), '125006712X', 'Test GetNormalizedISBN' );
119
is( C4::Koha::GetNormalizedISBN('9781250067128 | 125006712X'), '125006712X', 'Test GetNormalizedISBN' );
120
is( C4::Koha::GetNormalizedISBN('9780373211463 | 0373211465'), '0373211465', 'Test GetNormalizedISBN' );
120
is( C4::Koha::GetNormalizedISBN('9780373211463 | 0373211465'), '0373211465', 'Test GetNormalizedISBN' );
121
121
122
<<<<<<< HEAD
123
is( C4::Koha::GetNormalizedUPC(), undef, 'GetNormalizedUPC should return undef if no record is passed' );
122
is( C4::Koha::GetNormalizedUPC(), undef, 'GetNormalizedUPC should return undef if no record is passed' );
124
is( C4::Koha::GetNormalizedISBN(), undef, 'GetNormalizedISBN should return undef if no record and no isbn are passed' );
123
is( C4::Koha::GetNormalizedISBN(), undef, 'GetNormalizedISBN should return undef if no record and no isbn are passed' );
125
is( C4::Koha::GetNormalizedEAN(), undef, 'GetNormalizedEAN should return undef if no record and no isbn are passed' );
124
is( C4::Koha::GetNormalizedEAN(), undef, 'GetNormalizedEAN should return undef if no record and no isbn are passed' );
Lines 150-156 subtest 'getFacets() tests' => sub { Link Here
150
        'location facet present with singleBranchMode off (bug 10078)'
149
        'location facet present with singleBranchMode off (bug 10078)'
151
    );
150
    );
152
};
151
};
153
=======
154
152
155
is(C4::Koha::NormalizeISSN({ issn => '0024-9319', strip_hyphen => 1 }), '00249319', 'Test NormalizeISSN with all features enabled' );
153
is(C4::Koha::NormalizeISSN({ issn => '0024-9319', strip_hyphen => 1 }), '00249319', 'Test NormalizeISSN with all features enabled' );
156
is(C4::Koha::NormalizeISSN({ issn => '0024-9319', strip_hyphen => 0 }), '0024-9319', 'Test NormalizeISSN with all features enabled' );
154
is(C4::Koha::NormalizeISSN({ issn => '0024-9319', strip_hyphen => 0 }), '0024-9319', 'Test NormalizeISSN with all features enabled' );
Lines 166-172 eval { Link Here
166
ok($@ eq '', 'NormalizeISSN does not throw exception when parsing invalid ISSN');
164
ok($@ eq '', 'NormalizeISSN does not throw exception when parsing invalid ISSN');
167
165
168
@issns = GetVariationsOfISSNs('abc');
166
@issns = GetVariationsOfISSNs('abc');
169
is(scalar(@issns), 0, 'zero variations returned of invalid ISSN');
167
is($issns[0], 'abc', 'Original ISSN passed through even if invalid');
170
>>>>>>> Bug 14629 - Add aggressive ISSN matching feature equivalent to the aggressive ISBN matcher
168
is(scalar(@issns), 1, 'zero additional variations returned of invalid ISSN');
171
169
172
1;
170
1;
173
- 

Return to bug 14629