Skip to content

Commit 7ce5fd6

Browse files
committed
The attribute of CustomFieldView should be the same as CustomField
Like OwnerName's attribute is also Owner. This commit makes CustomFieldView columns sortable(via the header links on search results page).
1 parent 2952c19 commit 7ce5fd6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

share/html/Elements/ColumnMap

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,11 +412,17 @@ $WCOLUMN_MAP = $COLUMN_MAP = {
412412
$COLUMN_MAP->{'CF'} = $COLUMN_MAP->{'CustomField'};
413413

414414
# Add a CustomFieldView column for custom fields, but with editing disabled
415-
$COLUMN_MAP->{'CustomFieldView'} = {};
415+
$COLUMN_MAP->{'CustomFieldView'} = {
416+
attribute => sub {
417+
my $attr = $_[0];
418+
$attr =~ s!CustomFieldView!CustomField!;
419+
return $attr;
420+
},
421+
};
416422

417-
# We copy all keys from CF to CustomFieldView except for "edit"
423+
# We copy all keys from CF to CustomFieldView except for "edit" and overridden ones
418424
foreach my $key ( keys( %{ $COLUMN_MAP->{'CF'} } ) ) {
419-
next if $key eq 'edit';
425+
next if $key eq 'edit' || $COLUMN_MAP->{'CustomFieldView'}->{$key};
420426
$COLUMN_MAP->{'CustomFieldView'}->{$key} = $COLUMN_MAP->{'CF'}->{$key};
421427
}
422428

0 commit comments

Comments
 (0)