function TaxonomyTermModerationHandler::enforceRevisionsBundleFormAlter

Same name in other branches
  1. 10 core/modules/content_moderation/src/Entity/Handler/TaxonomyTermModerationHandler.php \Drupal\content_moderation\Entity\Handler\TaxonomyTermModerationHandler::enforceRevisionsBundleFormAlter()

Overrides ModerationHandler::enforceRevisionsBundleFormAlter

File

core/modules/content_moderation/src/Entity/Handler/TaxonomyTermModerationHandler.php, line 26

Class

TaxonomyTermModerationHandler
Customizations for taxonomy term entities.

Namespace

Drupal\content_moderation\Entity\Handler

Code

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

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