if (exists($self->{_mfhdh_FIELDS}->{$key})) {
carp("Duplicate, non-repeatable subfield '$key' found, ignoring");
next;
+ } elsif (!$caption->capfield($key)) {
+ carp("Subfield '$key' has no corresponding caption, ignoring");
+ next;
}
if ($self->{_mfhdh_COMPRESSED}) {
$self->{_mfhdh_FIELDS}->{$key}{HOLDINGS} = [split(/\-/, $val, -1)];
if (exists $self->fields->{$key}) {
my @values = @{$self->fields->{$key}{HOLDINGS}};
return \@values;
+ } elsif ($self->caption->capfield($key)) {
+ carp("No values found for existing caption subfield '$key', returning '*' (unknown value indicator)");
+ if ($self->is_compressed) {
+ return ['*', '*'];
+ } else {
+ return ['*'];
+ }
} else {
- return undef;
+ return;
}
}
sub caption {
my $self = shift;
+ my $caption = shift;
+
+ if ($caption) {
+ $self->{_mfhdh_CAPTION} = $caption;
+ }
return $self->{_mfhdh_CAPTION};
}