You are here

public function BlockContentModerationHandler::enforceRevisionsBundleFormAlter in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/content_moderation/src/Entity/Handler/BlockContentModerationHandler.php \Drupal\content_moderation\Entity\Handler\BlockContentModerationHandler::enforceRevisionsBundleFormAlter()
  2. 9 core/modules/content_moderation/src/Entity/Handler/BlockContentModerationHandler.php \Drupal\content_moderation\Entity\Handler\BlockContentModerationHandler::enforceRevisionsBundleFormAlter()

File

core/modules/content_moderation/src/Entity/Handler/BlockContentModerationHandler.php, line 27

Class

BlockContentModerationHandler
Customizations for block content entities.

Namespace

Drupal\content_moderation\Entity\Handler

Code

public function enforceRevisionsBundleFormAlter(array &$form, FormStateInterface $form_state, $form_id) {
  $form['revision']['#default_value'] = 1;
  $form['revision']['#disabled'] = TRUE;
  $form['revision']['#description'] = $this
    ->t('Revisions must be required when moderation is enabled.');
}