A subprocess step that reopens its parent's webform submission never resumes
Closes #3628484.
The bug
A webform that starts a workflow is bound to the instance it started. When a step of a subprocess reopens that submission (an editable review whose submission id the parent hands down), OrchestraInteractionHandler::postSave() looked for the step's token in the bound instance, the parent. The token belongs to the child, so it was not found: the submit was saved, the step stayed parked, the task stayed open, and the actor was told nothing (the only warning sat in an elseif ($token !== NULL)).
Found on a real setup: test_webform_rh starts the form and runs test_webform as a subprocess, whose "Demande de modification" step never completed on submit.
The fix
- On a bound re-edit, the step is resumed in the instance its handle names (the resolved continuation already carries it), when that instance is the bound one or one of its subprocesses, found by walking up the parent tokens (
findStepInstance()). A submission still cannot resume a step of an unrelated instance; the assigned-actor check is unchanged. - A handle naming an unrelated instance: the actor gets the existing "Your answers were saved, but this step was not completed" warning, and the site log says which instances were involved.
- A handle whose step has already moved on (a step completed between opening the form and submitting it): "Your answers were saved, but this step has already moved on, so the workflow did not change." instead of silence. The render gate already refuses such a form up front with its own "already moved on" message; this covers the race after it.
- The return to the workflow follows the same instance: after a subprocess step the visitor is sent to the subprocess's next step, or back to the parent run once the subprocess has ended (it used to build the link from the bound instance, so the visitor landed on the parent still parked on its subprocess node).
SubmissionBinding::isBoundToInstanceOrAncestor(): the one check of whose submission it is, now shared by the step that shows the submission (WebformInteraction, which had its own copy) and the handler that resumes with it.docs/webform.md: "A subprocess that reopens the parent's submission", including where the child step stores the answers (in the child; the output map passes them back).- French for both strings.
Tests
testSubprocessStepResumesTheParentsSubmission: a parent run bound to the submission, a child started by its subprocess node, the edit through the child's step: the child resumes and runs to its end, the answers land in the child, no warning. Saved once, as a real submit (the handler runs from the save).testStepOfUnrelatedInstanceIsNotResumed: a handle for another run's step leaves it parked and warns.testReeditAfterBranchAdvancedIsNoOpalso asserts the new "already moved on" warning.- All three fail against the previous handler.
testTheStepWhoseBranchMovedOnIsNotSubmittableclears the fixture's own warning before asserting what the form says up front. testReturnAfterSubprocessStepOpensTheSubprocessandtestReturnAfterLastSubprocessStepOpensTheParent: the return link opens the child at its next step, or the parent once the child has ended; each fails against the bound-instance link.OrchestraInteractionHandlerTestpasses whole (41 tests, rebased on !617 (merged)).
Rebased onto 1.x after !617 (merged) merged: the two touched the same test file, catalog and docs anchor, so the branch is now one commit plus a doc follow-up.