Skip to content

Call to a member function getCurrentRequest() on null #318

@kironet

Description

@kironet

Hey,

I have a problem with this bundle and new symfony 4.
Here is my code:

    public function index(CheckoutFlow $flow, $id = null): Response
    {

        .....

        $flow->bind($order);

        // form of the current step
        $form = $flow->createForm();
        if ($flow->isValid($form)) {
            $flow->saveCurrentStepData($form);

            if ($flow->nextStep()) {
                // form for the next step
                $form = $flow->createForm();
            } else {
                // flow finished
                $em->persist($order);
                $em->flush();

                $response = ...

                return $response;
            }
        }

        return $this->render('shop/checkout/index.html.twig', [
            'form' => $form->createView(),
            'flow' => $flow,
        ]);

    }
services:
    App\Form\Checkout\CheckoutFlow:
        parent: craue.form.flow

And I'm getting this error:

Call to a member function getCurrentRequest() on null

Am I doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions