Skip to content

Commit

Permalink
Issue #2648: Enabled dynamic field Reference DisplayValueRender to in…
Browse files Browse the repository at this point in the history
…clude empty values which can occur in multivalue case.
  • Loading branch information
stefanhaerter committed Nov 9, 2023
1 parent 6833e3f commit 8394870
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions Kernel/System/DynamicField/Driver/Reference.pm
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,6 @@ sub DisplayValueRender {
@ObjectIDs = ( $Param{Value} );
}

@ObjectIDs = grep { defined $_ } @ObjectIDs;

# get descriptive names for the values, e.g. TicketNumber for TicketID
my @LongObjectDescriptions;
my $Link;
Expand All @@ -551,13 +549,18 @@ sub DisplayValueRender {
);
if ($PluginObject) {
for my $ObjectID (@ObjectIDs) {
my %Description = $PluginObject->ObjectDescriptionGet(
ObjectID => $ObjectID,
Link => $HTMLOutput,
LayoutObject => $Param{LayoutObject},
);
push @LongObjectDescriptions, $Description{Long};
$Link = $Description{Link};
if ($ObjectID) {
my %Description = $PluginObject->ObjectDescriptionGet(
ObjectID => $ObjectID,
Link => $HTMLOutput,
LayoutObject => $Param{LayoutObject},
);
push @LongObjectDescriptions, $Description{Long};
$Link = $Description{Link};
}
else {
push @LongObjectDescriptions, '';
}
}
}
}
Expand Down Expand Up @@ -613,16 +616,14 @@ sub DisplayValueRender {
}

push @ReadableValues, $ReadableValue;
if ( length $ReadableTitle ) {
push @ReadableTitles, $ReadableTitle;
}
push @ReadableTitles, $ReadableTitle;
}

# set new line separator
my $ItemSeparator = $HTMLOutput ? '<br>' : '\n';
my $ItemSeparator = $HTMLOutput ? '<br/>' : '\n';

my $Value = join $ItemSeparator, @ReadableValues;
my $Title = join $ItemSeparator, @ReadableTitles;
my $Title = join ', ', @ReadableTitles;

if ($ShowValueEllipsis) {
$Value .= '...';
Expand Down

0 comments on commit 8394870

Please sign in to comment.