3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00

Specify views plugins for improved sorting of the log.timestamp field.

This commit is contained in:
paul121 2020-12-17 15:58:33 -08:00 committed by Michael Stenta
parent 72139c7b67
commit 0681f867ae

View file

@ -141,6 +141,12 @@ function farm_entity_entity_base_field_info_alter(&$fields, EntityTypeInterface
*/
function farm_entity_views_data_alter(array &$data) {
// Specify views plugins for improved sorting of the log.timestamp field.
if (!empty($data['log_field_data'])) {
$data['log_field_data']['timestamp']['sort']['id'] = 'log_standard';
$data['log_field_data']['timestamp']['field']['id'] = 'log_field';
}
// Because Drupal core does not provide full Views integration for base fields
// we must manually specify the state_machine_state views filter for the
// status field.