This change only affects sites that have enabled configurable display of node base fields (title, uid and created) by means of a hook:
/**
* Implements hook_entity_base_field_info_alter().
*/
function examplemodule_entity_base_field_info_alter(&$base_field_definitions, EntityTypeInterface $entity_type) {
if ($entity_type->id() == 'node') {
$base_field_definitions['created']->setDisplayConfigurable('view', TRUE);
}
}
Before
A special field template was used for these base fields that displayed the values inline and didn't render the label or many of the attributes and classes of a normal field.
A workaround was possible like this:
/**
* Implements hook_theme_registry_alter().
*/
function mymodule_theme_registry_alter(&$theme_registry) {
unset($theme_registry['field__node__title']);
unset($theme_registry['field__node__uid']);
unset($theme_registry['field__node__created']);
}
After
The normal field template will be used if configurable display is enabled. To maintain back-compatibility, this only occurs if an additional entity type property (introduced in this Change Record) has been set:
function mymodule_entity_type_build(array &$entity_types) {
$entity_types['node']->set('enable_base_field_custom_preprocess_skipping', TRUE);
}
Template changes
In the Core themes (Stable, Classy, Bartik), the node field templates field--node--title.html.twig, field--node--created.html.twig, field--node--uid.html.twig have been changed to check a new variable is_inline:
{% if not is_inline %}
{% include "field.html.twig" %}
{% else %}
...
Contrib theme developers that override any of these templates should make the corresponding changes. In the common case where the theme inherits those templates from one of the Core themes, then no changes are required.