Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By timmillwood on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.4.0
Introduced in version:
8.4.0
Issue links:
Description:
Views is a query builder at heart, so generally just displays fields that have database columns associated with them.
Now Views can also support computed fields to display fields that don't have associated database columns.
Example from \Drupal\entity_test\EntityTestViewsData
mapping an entity's computed field to Views:
$views_data['entity_test_computed_field']['computed_string_field'] = [
'title' => $this->t('Computed String Field'),
'field' => [
'id' => 'field',
'default_formatter' => 'string',
'field_name' => 'computed_string_field',
],
];
Impacts:
Module developers