public function NodeModerationHandler::enforceRevisionsEntityFormAlter in Workbench Moderation 8
Same name and namespace in other branches
- 8.2 src/Entity/Handler/NodeModerationHandler.php \Drupal\workbench_moderation\Entity\Handler\NodeModerationHandler::enforceRevisionsEntityFormAlter()
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
File
- src/
Entity/ Handler/ NodeModerationHandler.php, line 15
Class
- NodeModerationHandler
- Customizations for node entities.
Namespace
Drupal\workbench_moderation\Entity\HandlerCode
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.');
}