important bug fix for bug introduced in 1.57: it might eat your data
[webpac] / all2xml.pl
index c625e3f..3588f1c 100755 (executable)
@@ -321,7 +321,7 @@ sub data2xml {
                                        } else {
                                                $display_data .= $ldel if ($display_data);
                                                my $tmp = mkformat($x,$display);
-                                               $display_data = $tmp if ($tmp);
+                                               $display_data .= $tmp if ($tmp);
                                        }
                                }
                                                
@@ -789,14 +789,14 @@ print STDERR "using: $type...\n";
                my $marc_file = $cfg -> val($database, 'marc_file') || die "$database doesn't have 'marc_file' defined!";
 
                # optional argument is format
-               my $format = x($config->{format}) || 'usmarc';
+               my $format = x($config->{marc_format}) || 'usmarc';
 
                print STDERR "Reading MARC file '$marc_file'\n";
 
                my $marc = new MARC;
                my $nr = $marc->openmarc({
                                file=>$marc_file, format=>$format
-                       }) || die "Can't open MARC file '$marc_file'";
+                       }) || die "Can't open MARC file '$marc_file' with format '$format'";
 
                # read MARC file in memory
                $marc->nextmarc(-1);