This version adds support for concurrent instances of the same flow, which required a change in the handling of flows.
-
When performing a GET request without any additional parameters to run a flow with dynamic step navigation enabled, it has just been reused as there could only be one instance using the default session storage. So previously, the data of all steps would still be available. Now, a new flow instance will be started. Thus, if you want to provide a custom link to the same flow instance, (beside the optional step number) you now need to add the instance id as parameter
instance
(per default).before:
<a href="{{ path('createTopic', {'step': 2}) }}">continue creating a topic</a>
after:
<a href="{{ path('createTopic', {'instance': flow.getInstanceId(), 'step': 2}) }}">continue creating a topic</a>
-
For the same reason, it's no longer necessary to use a dedicated action to reset a flow in order to start it with clean data.
before:
/** * @Route("/create-topic/start/", name="createTopic_start") */ public function createTopicStartAction() { $flow = $this->get('form.flow.createTopic'); $flow->reset(); return $this->redirect($this->generateUrl('createTopic')); }
<a href="{{ path('createTopic_start') }}">create a topic</a>
after:
<a href="{{ path('createTopic') }}">create a topic</a>
-
To remove saved step data from the session when finishing the flow you should call
$flow->reset()
at the end of the action.before:
public function createTopicAction() { // ... // flow finished // persist data to the DB or whatever... // redirect when done... }
after:
public function createTopicAction() { // ... // flow finished // persist data to the DB or whatever... $flow->reset(); // redirect when done... }
-
Options cannot be passed to step forms using
createForm
anymore. You can now usesetGenericFormOptions
for that.before:
$flow->bind($formData); $form = $flow->createForm(array('action' => 'targetUrl'));
after:
$flow->bind($formData); $flow->setGenericFormOptions(array('action' => 'targetUrl')); $form = $flow->createForm();
-
Some methods have been renamed.
PostBindRequestEvent
:getStep
togetStepNumber
PostBindSavedDataEvent
:getStep
togetStepNumber
-
Some properties have been renamed.
PostBindRequestEvent
:step
tostepNumber
PostBindSavedDataEvent
:step
tostepNumber
-
Some methods have been removed.
setStepDataKey
/getStepDataKey
setStorage
/getStorage
(usesetDataManager
/getDataManager
instead)
-
Some methods have been renamed.
setDynamicStepNavigationParameter
tosetDynamicStepNavigationStepParameter
getDynamicStepNavigationParameter
togetDynamicStepNavigationStepParameter
-
A property has been renamed.
dynamicStepNavigationParameter
todynamicStepNavigationStepParameter
-
The Twig filters
craue_addDynamicStepNavigationParameter
andcraue_removeDynamicStepNavigationParameter
have been renamed tocraue_addDynamicStepNavigationParameters
andcraue_removeDynamicStepNavigationParameters
, i.e. pluralized, since they now handle more than one parameter. -
The template
CraueFormFlowBundle:FormFlow:stepField.html.twig
(deprecated in 2.1.0) has been removed.