function CommentHooks::fieldConfigUpdate

Implements hook_ENTITY_TYPE_update() for 'field_config'.

Attributes

#[Hook('field_config_update')]

File

core/modules/comment/src/Hook/CommentHooks.php, line 138

Class

CommentHooks
Hook implementations for comment.

Namespace

Drupal\comment\Hook

Code

public function fieldConfigUpdate(FieldConfigInterface $field) : void {
  if ($field->getType() == 'comment') {
    // Comment field settings also affects the rendering of *comment*
    // entities, not only the *commented* entities.
    \Drupal::entityTypeManager()->getViewBuilder('comment')
      ->resetCache();
  }
}

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