public function WorkflowTransitionForm::form in Workflow 8
This function is called by buildForm().
Caveat: !! It is not declared in the EntityFormInterface !!
Overrides ContentEntityForm::form
File
- src/
Form/ WorkflowTransitionForm.php, line 66
Class
- WorkflowTransitionForm
- Provides a Transition Form to be used in the Workflow Widget.
Namespace
Drupal\workflow\FormCode
public function form(array $form, FormStateInterface $form_state) {
// Call parent to get (extra) fields.
// This might cause baseFieldDefinitions to appear twice.
$form = parent::form($form, $form_state);
/** @var \Drupal\workflow\Entity\WorkflowTransitionInterface $transition */
$transition = $this->entity;
// Do not pass the element, but the form.
// $element['#default_value'] = $transition;
// $form += WorkflowTransitionElement::transitionElement($element, $form_state, $form);
//
// Pass the form via parameter.
$form['#default_value'] = $transition;
$form = WorkflowTransitionElement::transitionElement($form, $form_state, $form);
return $form;
}