diff --git a/core/modules/workflows/src/Plugin/WorkflowTypeBase.php b/core/modules/workflows/src/Plugin/WorkflowTypeBase.php index 34af735..66702d0 100644 --- a/core/modules/workflows/src/Plugin/WorkflowTypeBase.php +++ b/core/modules/workflows/src/Plugin/WorkflowTypeBase.php @@ -86,20 +86,6 @@ public function deleteTransition($transition_id) { /** * {@inheritdoc} */ - public function buildStateConfigurationForm(FormStateInterface $form_state, WorkflowInterface $workflow, StateInterface $state = NULL) { - return []; - } - - /** - * {@inheritdoc} - */ - public function buildTransitionConfigurationForm(FormStateInterface $form_state, WorkflowInterface $workflow, TransitionInterface $transition = NULL) { - return []; - } - - /** - * {@inheritdoc} - */ public function getConfiguration() { return $this->configuration; } diff --git a/core/modules/workflows/src/Plugin/WorkflowTypeFormBase.php b/core/modules/workflows/src/Plugin/WorkflowTypeFormBase.php index 942c2d6..69f0e8c 100644 --- a/core/modules/workflows/src/Plugin/WorkflowTypeFormBase.php +++ b/core/modules/workflows/src/Plugin/WorkflowTypeFormBase.php @@ -3,6 +3,9 @@ namespace Drupal\workflows\Plugin; use Drupal\Core\Form\FormStateInterface; +use Drupal\workflows\StateInterface; +use Drupal\workflows\TransitionInterface; +use Drupal\workflows\WorkflowInterface; use Drupal\workflows\WorkflowTypeFormInterface; /** @@ -27,4 +30,18 @@ public function validateConfigurationForm(array &$form, FormStateInterface $form public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { } + /** + * {@inheritdoc} + */ + public function buildStateConfigurationForm(FormStateInterface $form_state, WorkflowInterface $workflow, StateInterface $state = NULL) { + return []; + } + + /** + * {@inheritdoc} + */ + public function buildTransitionConfigurationForm(FormStateInterface $form_state, WorkflowInterface $workflow, TransitionInterface $transition = NULL) { + return []; + } + } diff --git a/core/modules/workflows/src/WorkflowTypeFormInterface.php b/core/modules/workflows/src/WorkflowTypeFormInterface.php index 7da4bd9..d5c957b 100644 --- a/core/modules/workflows/src/WorkflowTypeFormInterface.php +++ b/core/modules/workflows/src/WorkflowTypeFormInterface.php @@ -2,6 +2,7 @@ namespace Drupal\workflows; +use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Plugin\PluginFormInterface; /** @@ -13,4 +14,44 @@ * @see plugin_api */ interface WorkflowTypeFormInterface extends PluginFormInterface, WorkflowTypeInterface { + + /** + * Builds a form to be added to the Workflow state edit form. + * + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The form state. + * @param \Drupal\workflows\WorkflowInterface $workflow + * The workflow the state is attached to. + * @param \Drupal\workflows\StateInterface|null $state + * The workflow state being edited. If NULL, a new state is being added. + * + * @return array + * Form elements to add to a workflow state form for customisations to the + * workflow. + * + * @see \Drupal\workflows\Form\WorkflowStateAddForm::form() + * @see \Drupal\workflows\Form\WorkflowStateEditForm::form() + */ + public function buildStateConfigurationForm(FormStateInterface $form_state, WorkflowInterface $workflow, StateInterface $state = NULL); + + /** + * Builds a form to be added to the Workflow transition edit form. + * + * @param \Drupal\Core\Form\FormStateInterface $form_state + * The form state. + * @param \Drupal\workflows\WorkflowInterface $workflow + * The workflow the state is attached to. + * @param \Drupal\workflows\TransitionInterface|null $transition + * The workflow transition being edited. If NULL, a new transition is being + * added. + * + * @return array + * Form elements to add to a workflow transition form for customisations to + * the workflow. + * + * @see \Drupal\workflows\Form\WorkflowTransitionAddForm::form() + * @see \Drupal\workflows\Form\WorkflowTransitionEditForm::form() + */ + public function buildTransitionConfigurationForm(FormStateInterface $form_state, WorkflowInterface $workflow, TransitionInterface $transition = NULL); + } diff --git a/core/modules/workflows/src/WorkflowTypeInterface.php b/core/modules/workflows/src/WorkflowTypeInterface.php index 2412bf9..7519cb1 100644 --- a/core/modules/workflows/src/WorkflowTypeInterface.php +++ b/core/modules/workflows/src/WorkflowTypeInterface.php @@ -105,45 +105,6 @@ public function deleteTransition($transition_id); public function getInitialState(WorkflowInterface $workflow); /** - * Builds a form to be added to the Workflow state edit form. - * - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form state. - * @param \Drupal\workflows\WorkflowInterface $workflow - * The workflow the state is attached to. - * @param \Drupal\workflows\StateInterface|null $state - * The workflow state being edited. If NULL, a new state is being added. - * - * @return array - * Form elements to add to a workflow state form for customisations to the - * workflow. - * - * @see \Drupal\workflows\Form\WorkflowStateAddForm::form() - * @see \Drupal\workflows\Form\WorkflowStateEditForm::form() - */ - public function buildStateConfigurationForm(FormStateInterface $form_state, WorkflowInterface $workflow, StateInterface $state = NULL); - - /** - * Builds a form to be added to the Workflow transition edit form. - * - * @param \Drupal\Core\Form\FormStateInterface $form_state - * The form state. - * @param \Drupal\workflows\WorkflowInterface $workflow - * The workflow the state is attached to. - * @param \Drupal\workflows\TransitionInterface|null $transition - * The workflow transition being edited. If NULL, a new transition is being - * added. - * - * @return array - * Form elements to add to a workflow transition form for customisations to - * the workflow. - * - * @see \Drupal\workflows\Form\WorkflowTransitionAddForm::form() - * @see \Drupal\workflows\Form\WorkflowTransitionEditForm::form() - */ - public function buildTransitionConfigurationForm(FormStateInterface $form_state, WorkflowInterface $workflow, TransitionInterface $transition = NULL); - - /** * Gets the required states of workflow type. * * This are usually configured in the workflow type annotation.