Bug 9201 OAI-PMH mapping value cannot be 0
authorMirko Tietgen <mirko@abunchofthings.net>
Thu, 13 Dec 2012 22:37:58 +0000 (23:37 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Mon, 4 Feb 2013 13:15:54 +0000 (08:15 -0500)
Allow the value of a OAI set mapping to be 0 / empty. Delete the mapping if field or subfield are empty.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Now it is possible to add a value == 0 or an empty string.
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

admin/oai_set_mappings.pl

index 1a9762c..fb4ee28 100755 (executable)
@@ -60,7 +60,7 @@ if($op && $op eq "save") {
     my @mappings;
     my $i = 0;
     while($i < @marcfields and $i < @marcsubfields and $i < @marcvalues) {
-        if($marcfields[$i] and $marcsubfields[$i] and $marcvalues[$i]) {
+        if($marcfields[$i] and $marcsubfields[$i]) {
             push @mappings, {
                 marcfield    => $marcfields[$i],
                 marcsubfield => $marcsubfields[$i],