Skip to content

Commit

Permalink
The attribute of CustomFieldView should be the same as CustomField
Browse files Browse the repository at this point in the history
Like OwnerName's attribute is also Owner.

This commit makes CustomFieldView columns sortable(via the header links on
search results page).
  • Loading branch information
sunnavy committed Jun 5, 2024
1 parent 2952c19 commit 7ce5fd6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions share/html/Elements/ColumnMap
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,17 @@ $WCOLUMN_MAP = $COLUMN_MAP = {
$COLUMN_MAP->{'CF'} = $COLUMN_MAP->{'CustomField'};

# Add a CustomFieldView column for custom fields, but with editing disabled
$COLUMN_MAP->{'CustomFieldView'} = {};
$COLUMN_MAP->{'CustomFieldView'} = {
attribute => sub {
my $attr = $_[0];
$attr =~ s!CustomFieldView!CustomField!;
return $attr;
},
};

# We copy all keys from CF to CustomFieldView except for "edit"
# We copy all keys from CF to CustomFieldView except for "edit" and overridden ones
foreach my $key ( keys( %{ $COLUMN_MAP->{'CF'} } ) ) {
next if $key eq 'edit';
next if $key eq 'edit' || $COLUMN_MAP->{'CustomFieldView'}->{$key};
$COLUMN_MAP->{'CustomFieldView'}->{$key} = $COLUMN_MAP->{'CF'}->{$key};
}

Expand Down

0 comments on commit 7ce5fd6

Please sign in to comment.