Skip to content

Conversation

@yceruto
Copy link
Member

@yceruto yceruto commented Nov 19, 2025

Q A
Branch? 7.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #62445
License MIT

This fixes cases where the last step can't be reached because it's currently skipped, which should mark the end of the process instead of throwing a runtime exception: "Cannot determine next step."

Then $flow->isFinished() will return true, but you must call the handler of the clicked button manually before checking $flow->isFinished() so this escenario will be covered:

if ($flow->isSubmitted() && $flow->isValid()) {
    // ensure the flow button is handled before checking whether it's finished
    $flow->getClickedButton()->handle();

    if ($flow->isFinished()) {
        // do something with $form->getData()

        return $this->redirectToRoute('some_route');
    }
}

For other cases, you can continue using the simplified version of this controller.

@yceruto yceruto force-pushed the fix_formflow_finished branch from a3232d5 to 80bfa88 Compare November 20, 2025 12:20
@yceruto yceruto force-pushed the fix_formflow_finished branch from 80bfa88 to b986b6f Compare November 20, 2025 12:20
@nicolas-grekas
Copy link
Member

Thank you @yceruto.

@nicolas-grekas nicolas-grekas merged commit 7acaf00 into symfony:7.4 Nov 20, 2025
9 of 12 checks passed
@yceruto yceruto deleted the fix_formflow_finished branch November 20, 2025 12:51
This was referenced Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants