"salesman" => "e.name"
);
+ $form->{sort} ||= "name";
my $sortorder;
if ( $join_records ) {
# in UNION case order by hash key, e.g. salesman
# the UNION created an implicit select around the result
- $sortorder = $form->{sort} && $allowed_sort_columns{$form->{sort}} ? $form->{sort} : "name";
+ $sortorder = $allowed_sort_columns{$form->{sort}} ? $form->{sort} : "name";
} else {
# in not UNION case order by hash value, e.g. e.name
- $sortorder = $form->{sort} && $allowed_sort_columns{$form->{sort}} ? $allowed_sort_columns{$form->{sort}} : "ct.name";
+ $sortorder = $allowed_sort_columns{$form->{sort}} ? $allowed_sort_columns{$form->{sort}} : "ct.name";
};
- $form->{sort} = $sortorder;
my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
if ($sortorder !~ /(business|id)/ && !$join_records) {