craue / CraueFormFlowBundle

Multi-step forms for your Symfony project.
MIT License
736 stars 118 forks source link

Expensive requests in form steps #340

Closed Roysten closed 5 years ago

Roysten commented 5 years ago

I use this bundle to create a wizard and it works well. I fill the forms using data I get by doing a request to an external application. These requests may take a significant amount of time (up to 10 seconds). I request this data in the buildForm function.

Unfortunately when using the same construction as in the example controller, the buildForm function is called multiple times. E.g. if I am on step 3 and I want to navigate to step 4 it is called 4 times (once with flow_step = 1, once with flow_step = 2, etc). Since most steps do this slow request to the external application it can take up to 40 seconds to navigate to page 4.

Is there a way to prevent doing these expensive requests for each already completed step? Or is the only way to request all this data before starting the wizard?

craue commented 5 years ago

Take a look at https://github.com/craue/CraueFormFlowBundle/blob/master/README.md#disabling-revalidation-of-previous-steps.

Roysten commented 5 years ago

Sorry I forgot to mention that I already tried setting that to false, but it does not seem to work. buildForm is still called multiple times.

craue commented 5 years ago

Oh right, that's something different. There's no quick solution then.

Roysten commented 5 years ago

Ah okay, thank you :+1:

tacoor commented 4 years ago

Its a pitty there is no solution

I've been using for a while now but the calls of buildforms all the forms (8 steps) is too expensive making the wizard too slow