Bug 12674: GetMarcISSN should not return empty ISSN
authorTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 29 Jul 2014 19:12:52 +0000 (16:12 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 1 Sep 2014 13:42:15 +0000 (10:42 -0300)
This patch makes GetMarcISSN test for empty subfield before pushing to the
result array.

To test:
- Run the regression test
=> FAILS for all MARC flavours
- Apply the patch
- Run the regression test
=> SUCCESS: tests pass
- Sign off

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Biblio.pm

index eb2ee2f..f2e7014 100644 (file)
@@ -1730,7 +1730,8 @@ sub GetMarcISSN {
     }
     my @marcissns;
     foreach my $field ( $record->field($scope) ) {
-        push @marcissns, $field->subfield( 'a' );
+        push @marcissns, $field->subfield( 'a' )
+            if ( $field->subfield( 'a' ) ne "" );
     }
     return \@marcissns;
 }    # end GetMarcISSN