function NodeModerationHandler::enforceRevisionsEntityFormAlter

Same name in other branches
  1. 9 core/modules/content_moderation/src/Entity/Handler/NodeModerationHandler.php \Drupal\content_moderation\Entity\Handler\NodeModerationHandler::enforceRevisionsEntityFormAlter()
  2. 8.9.x core/modules/content_moderation/src/Entity/Handler/NodeModerationHandler.php \Drupal\content_moderation\Entity\Handler\NodeModerationHandler::enforceRevisionsEntityFormAlter()
  3. 10 core/modules/content_moderation/src/Entity/Handler/NodeModerationHandler.php \Drupal\content_moderation\Entity\Handler\NodeModerationHandler::enforceRevisionsEntityFormAlter()

Overrides ModerationHandler::enforceRevisionsEntityFormAlter

File

core/modules/content_moderation/src/Entity/Handler/NodeModerationHandler.php, line 46

Class

NodeModerationHandler
Customizations for node entities.

Namespace

Drupal\content_moderation\Entity\Handler

Code

public function enforceRevisionsEntityFormAlter(array &$form, FormStateInterface $form_state, $form_id) {
    $form['revision']['#disabled'] = TRUE;
    $form['revision']['#default_value'] = TRUE;
    $form['revision']['#description'] = $this->t('Revisions are required.');
}

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