function NodeModerationHandler::enforceRevisionsBundleFormAlter

Overrides ModerationHandler::enforceRevisionsBundleFormAlter

File

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

Class

NodeModerationHandler
Customizations for node entities.

Namespace

Drupal\content_moderation\Entity\Handler

Code

public function enforceRevisionsBundleFormAlter(array &$form, FormStateInterface $form_state, $form_id) {
  // Force the revision checkbox on.
  $form['workflow']['options']['revision']['#value'] = 'revision';
  $form['workflow']['options']['revision']['#disabled'] = TRUE;
}

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