Bug 38528: Update empty field value logic
prepare_cgi_additional_field_values needs to consider a field value as empty, because a MARC get field will always be submitted empty, and then picked up and handled by set_additional_fields accordingly.
But because we don't want to polute the database with tons of empty additional fields if many empty repeatable fields were submitted in the UI, the check for empty value still happens, but only after the MARC get check has happen, not before.
Signed-off-by: Baptiste <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f9561c59c2)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
This commit is contained in:
parent
6ea6ebdf11
commit
0effa890dd
|
|
@ -77,7 +77,7 @@ sub set_additional_fields {
|
|||
}
|
||||
}
|
||||
|
||||
if (defined $value) {
|
||||
if (defined $value && $value ne '') {
|
||||
my $field_value = Koha::AdditionalFieldValue->new({
|
||||
field_id => $additional_field->{id},
|
||||
record_id => $self->id,
|
||||
|
|
@ -113,7 +113,7 @@ sub prepare_cgi_additional_field_values {
|
|||
push @additional_fields, {
|
||||
id => $field->id,
|
||||
value => $value,
|
||||
} if defined $value && $value ne '';
|
||||
} if defined $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue