3
0
Fork 0
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:
Michael Stenta 2021-05-27 14:10:17 -04:00
parent f9f3305260
commit d766578731

View file

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