TaxonomyTermModerationHandler.php

Same filename in other branches
  1. 10 core/modules/content_moderation/src/Entity/Handler/TaxonomyTermModerationHandler.php

Namespace

Drupal\content_moderation\Entity\Handler

File

core/modules/content_moderation/src/Entity/Handler/TaxonomyTermModerationHandler.php

View source
<?php

namespace Drupal\content_moderation\Entity\Handler;

use Drupal\Core\Form\FormStateInterface;

/**
 * Customizations for taxonomy term entities.
 *
 * @internal
 */
class TaxonomyTermModerationHandler extends ModerationHandler {
    
    /**
     * {@inheritdoc}
     */
    public function enforceRevisionsEntityFormAlter(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.');
    }
    
    /**
     * {@inheritdoc}
     */
    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.');
    }

}

Classes

Title Deprecated Summary
TaxonomyTermModerationHandler Customizations for taxonomy term entities.

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