NodeModerationHandler::enforceRevisionsEntityFormAlter

public NodeModerationHandler::enforceRevisionsEntityFormAlter(array &$form, FormStateInterface $form_state, $form_id)

Alters entity forms to enforce revision handling.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

string $form_id: The form id.

Overrides ModerationHandler::enforceRevisionsEntityFormAlter

See also

hook_form_alter()

File

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

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.');
}
doc_Drupal
2016-10-29 09:31:01
Comments
Leave a Comment

Please login to continue.