- Issue created by @ajits
- Merge request !101Issue #3510629: Make "clone on publish" compatible with entity_workflow module. → (Closed) created by ajits
- 🇷🇴Romania amateescu
Thinking more about this, I think the issue should be moved to the
entity_workflow
module, and implemented like this in theentity_workflow_workspace
submodule:- implement a hook_form_alter that covers both
entity_workflow_form
andentity_workflow_simple_transition_form
- in that form alter, build and render the workspace publish form (directly forentity_workflow_simple_transition_form
, using #states forentity_workflow_form
)
- ensure that all form validators of the workspace publish form will run
- ensure that\Drupal\workspaces\Form\WorkspacePublishForm::submitForm()
does not run (because the actual publishing will be done by the workflow transition)This way, every customization/alter of the workspace publish form should be available in the workflow transition form.
- 🇮🇳India ajits India
@amateescu - Thank you! Moving this to the entity_workflow module.
- Merge request !11Issue #3510629: Make "clone on publish" compatible with entity_workflow module → (Open) created by ajits
- 🇮🇳India ajits India
> implement a hook_form_alter that covers both entity_workflow_form and entity_workflow_simple_transition_form
Done
> in that form alter, build and render the workspace publish form (directly for entity_workflow_simple_transition_form, using #states for entity_workflow_form)
This was not possible because the
EntityWorkflowSimpleTransitionForm
form usesrouteMatch
to check for the workspace transition; and the transition is not available (on load) forEntityWorkflowForm
.I have checked for other details and the MR should cover it. Please review.