mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
Sort the "Group" field before the "Location" field.
This commit is contained in:
parent
f9f3305260
commit
d766578731
|
@ -52,7 +52,7 @@ function farm_group_views_pre_view(ViewExecutable $view, $display_id, array &$ar
|
|||
// Alter the farm_asset View.
|
||||
if ($view->id() == 'farm_asset') {
|
||||
|
||||
// Add the computed "Group" field.
|
||||
// Add the computed "Group" field before the "Location" field.
|
||||
$field_options = [
|
||||
'type' => 'entity_reference_label',
|
||||
'label' => t('Group'),
|
||||
|
@ -60,7 +60,8 @@ function farm_group_views_pre_view(ViewExecutable $view, $display_id, array &$ar
|
|||
'link' => TRUE,
|
||||
],
|
||||
];
|
||||
$view->addHandler($display_id, 'field', 'asset', 'group', $field_options);
|
||||
$field_id = $view->addHandler($display_id, 'field', 'asset', 'group', $field_options);
|
||||
farm_ui_views_sort_field($view, $display_id, $field_id, 'location', TRUE);
|
||||
}
|
||||
|
||||
// Alter the farm_log View.
|
||||
|
|
Loading…
Reference in a new issue