Skip to content

Commit

Permalink
Issue #2725: Switched from PossibleValuesGet to DisplayValueRender to…
Browse files Browse the repository at this point in the history
… for reference ColumnFilterValuesGet to prevent performance issues.
  • Loading branch information
stefanhaerter committed Nov 30, 2023
1 parent a763eef commit 8adfd98
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Kernel/System/DynamicField/Driver/BaseEntity.pm
Original file line number Diff line number Diff line change
Expand Up @@ -783,9 +783,6 @@ sub ColumnFilterValuesGet {
my $DynamicField = $Param{DynamicFieldConfig};
my $FieldConfig = $DynamicField->{Config};

# set PossibleValues
my $SelectionData = $Self->PossibleValuesGet(%Param);

# article uses the same routine as ticket
my $ObjectType = $DynamicField->{ObjectType} eq 'Article' ? 'Ticket' : $DynamicField->{ObjectType};

Expand All @@ -798,8 +795,14 @@ sub ColumnFilterValuesGet {

# get the display value if still exist in dynamic field configuration
for my $Key ( sort keys %{$ColumnFilterValues} ) {
if ( $SelectionData->{$Key} ) {
$ColumnFilterValues->{$Key} = $SelectionData->{$Key};

my $DisplayValue = $Self->DisplayValueRender(
LayoutObject => $Param{LayoutObject},
Value => $Key,
);

if ( IsHashRefWithData($DisplayValue) ) {
$ColumnFilterValues->{$Key} = $DisplayValue->{Value};
}
}

Expand Down

0 comments on commit 8adfd98

Please sign in to comment.