Fixed #17627: custom fields not sorting correctly
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
@@ -118,10 +118,9 @@ class AssetsController extends Controller
|
||||
];
|
||||
|
||||
$all_custom_fields = CustomField::all(); //used as a 'cache' of custom fields throughout this page load
|
||||
|
||||
foreach ($all_custom_fields as $field) {
|
||||
// custom fields are prefixed with "custom_fields.".
|
||||
// We'll add them to the allowed columns so they can be searched.
|
||||
$allowed_columns[] = 'custom_fields.' . $field->db_column_name();
|
||||
$allowed_columns[] = $field->db_column_name();
|
||||
}
|
||||
|
||||
$filter = [];
|
||||
|
||||
@@ -328,7 +328,7 @@ class AssetPresenter extends Presenter
|
||||
// name can break the listings page. - snipe
|
||||
foreach ($fields as $field) {
|
||||
$layout[] = [
|
||||
'field' => 'custom_fields.'.$field->db_column,
|
||||
'field' => $field->db_column,
|
||||
'searchable' => true,
|
||||
'sortable' => true,
|
||||
'switchable' => true,
|
||||
|
||||
Reference in New Issue
Block a user