}
$sth = $dbh->prepare(
- "SELECT tagfield,tagsubfield,liblibrarian,libopac,tab,mandatory,repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl,link,defaultvalue
+ "SELECT tagfield,tagsubfield,liblibrarian,libopac,tab,mandatory,repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl,link,defaultvalue,maxlength
FROM marc_subfield_structure
WHERE frameworkcode=?
ORDER BY tagfield,tagsubfield
my $isurl;
my $link;
my $defaultvalue;
+ my $maxlength;
while (
( $tag, $subfield, $liblibrarian, $libopac, $tab, $mandatory, $repeatable, $authorised_value,
- $authtypecode, $value_builder, $kohafield, $seealso, $hidden, $isurl, $link, $defaultvalue
+ $authtypecode, $value_builder, $kohafield, $seealso, $hidden, $isurl, $link, $defaultvalue,
+ $maxlength
)
= $sth->fetchrow
) {
$res->{$tag}->{$subfield}->{isurl} = $isurl;
$res->{$tag}->{$subfield}->{'link'} = $link;
$res->{$tag}->{$subfield}->{defaultvalue} = $defaultvalue;
+ $res->{$tag}->{$subfield}->{maxlength} = $maxlength;
}
$marc_structure_cache->{$forlibrarian}->{$frameworkcode} = $res;
# ignore $9
my @this_link_loop = @link_loop;
- push @subfields_loop, { code => $code, value => $value, link_loop => \@this_link_loop, separator => $separator } unless ( $subject_subfield->[0] eq 9 );
+ push @subfields_loop, { code => $code, value => $value, link_loop => \@this_link_loop, separator => $separator } unless ( $subject_subfield->[0] eq 9 || $subject_subfield->[0] eq '0' );
$counter++;
}
link_loop => \@this_link_loop,
separator => $separator
}
- unless ( $authors_subfield->[0] eq '9' );
+ unless ( $authors_subfield->[0] eq '9' || $authors_subfield->[0] eq '0');
$count_auth++;
}
push @marcauthors, { MARCAUTHOR_SUBFIELDS_LOOP => \@subfields_loop };
my $db_to_marc = C4::Context->marcfromkohafield;
while ( my ($name, $value) = each %$hash ) {
next unless my $dtm = $db_to_marc->{''}->{$name};
+ next unless ( scalar( @$dtm ) );
my ($tag, $letter) = @$dtm;
foreach my $value ( split(/\s?\|\s?/, $value, -1) ) {
if ( my $field = $record->field($tag) ) {
=cut
sub ModBiblioMarc {
-
- # pass the MARC::Record to this function, and it will create the records in the marc field
+ # pass the MARC::Record to this function, and it will create the records in
+ # the marc field
my ( $record, $biblionumber, $frameworkcode ) = @_;
+
+ # Clone record as it gets modified
+ $record = $record->clone();
my $dbh = C4::Context->dbh;
my @fields = $record->fields();
if ( !$frameworkcode ) {