By tstoeckler on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
10.2.x
Introduced in version:
10.2.4
Issue links:
Description:
If a computed field is rendered using a formatter, the computed field item list class can now implement Drupal\Core\Cache\CacheableDependencyInterface in order to have it's cacheability metadata bubble to the rendered output.
Notes:
- The logic for this is added to
Drupal\Core\Field\FormatterBase, so formatters not extending that base class may need to re-implement this logic - This does not effect computed fields that are output via JSON:API (for now, see #3252278: Complete JSON:API's handling of field (including computed & empty fields) cache metadata)
- Theoretically the added logic applies to the field item list classes of non-computed fields, as well, but it generally does not make sense to apply cacheable metadata to non-computed fields
Impacts:
Module developers