Merge pull request #17636 from grokability/#17627-custom-fields-sorting

Fixed #17627: custom fields not sorting correctly
This commit is contained in:
snipe
2025-08-18 12:47:03 +01:00
committed by GitHub
2 changed files with 3 additions and 4 deletions

View File

@@ -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 = [];

View File

@@ -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,