- my @values = ();
- if ( ref $value eq 'ARRAY' ) {
- @values = @$value;
- } elsif ( $CF->Type =~ /text/i ) {
- @values = ($value);
- } else {
- @values = split /\r*\n/, ( defined $value ? $value : '');
- }
- @values = grep $_ ne '',
- map {
- s/\r+\n/\n/g;
- s/^\s+//;
- s/\s+$//;
- $_;
+ $m->notes(('Field-' . $CF->Id) => $submitted->{Values} // $submitted->{Value});
+
+ my @values = _NormalizeObjectCustomFieldValue(
+ CustomField => $CF,
+ Value => ($submitted->{Values} // $submitted->{Value} // $submitted->{Upload}),
+ );
+ if ($CF->Type =~ /^Date(?:Time)?$/) {
+ if (not @values) {
+ my $values = $Object->CustomFieldValues($CF->Id);
+ while (my $ocfv = $values->Next) {
+ push @values, $ocfv->Content;
+ }