diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 9688a9b4a..7c0444ca2 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -793,6 +793,7 @@ sub REPORT_COLUMNS { my $type = $field->value_type; $columns->{$field->name} = { + id => $field->name, name => $type->DB_TABLE.'.'.$type->NAME_FIELD, title => $field->description, joins => [ diff --git a/query.cgi b/query.cgi index cc2a3e750..43c43c9d0 100755 --- a/query.cgi +++ b/query.cgi @@ -178,7 +178,7 @@ $vars->{chfield} = [ # Fields for reports $vars->{report_columns} = [ - sort { $a->{title} cmp $b->{title} } + sort { $a->{sortkey} <=> $b->{sortkey} || $a->{title} cmp $b->{title} } values %{Bugzilla::Search::REPORT_COLUMNS()} ]; diff --git a/template/en/default/search/search-report-select.html.tmpl b/template/en/default/search/search-report-select.html.tmpl index 81bd04b58..192fb4bfd 100644 --- a/template/en/default/search/search-report-select.html.tmpl +++ b/template/en/default/search/search-report-select.html.tmpl @@ -28,7 +28,7 @@