function system_entity_view_mode_presave

Implements hook_ENTITY_TYPE_presave() for view mode entities.

Sets the description property to an empty string.

@todo Remove this BC layer in drupal:11.0.0.

File

core/modules/system/system.module, line 1407

Code

function system_entity_view_mode_presave(EntityViewModeInterface $entity_view_mode) {
    if ($entity_view_mode->get('description') === NULL) {
        $entity_view_mode->set('description', '');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.