You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting this error constantly, and having tried disabling CSRF protection and removing all of my more complicated FormType's, I'm at somewhat of a loss as to what is causing the problem.
Note: I tried removing the event listener, no change.
My FormType looks something like this:
public function buildForm(FormBuilderInterface $builder, array $options)
{
switch ($options['flowStep']) {
case 1:
$builder->addEventListener(FormEvents::PRE_SET_DATA, function($event) use ($builder) {
$form = $event->getForm();
$review = $event->getData();
$factory = $builder->getFormFactory();
if (!$review->getDealership()) {
$field = $factory->createNamed('dealership', 'dealership');
} else {
$field = $factory->createNamed('dealership', 'hidden', $review->getDealership()->getId());
}
$form->add($field);
});
$builder->add('ratings', 'collection', array(
'type' => new Rating,
));
$builder->add('comments');
break;
case 2:
$builder->add('department', 'department');
// $builder->add('employees');
$builder->add('visited', null, array(
'label' => 'Date of visited to dealership',
'format' => 'dd-MM-yyyy',
'years' => range(date('Y'), date('Y') - 2)
));;
break;
}
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'ACMEDemo\ReviewBundle\Entity\Review',
'flowStep' => 1
));
}
and my template features:
{% include 'CraueFormFlowBundle:FormFlow:stepField.html.twig' %}
Any thoughts on what the problem might be?
Also, when first loading the form, getCurrentStep returns null and I get a blank form, I have to click next to get to step 1, despite my setDefaultOptions looking like:
I'm getting this error constantly, and having tried disabling CSRF protection and removing all of my more complicated FormType's, I'm at somewhat of a loss as to what is causing the problem.
Note: I tried removing the event listener, no change.
My FormType looks something like this:
and my template features:
Any thoughts on what the problem might be?
Also, when first loading the form, getCurrentStep returns null and I get a blank form, I have to click next to get to step 1, despite my setDefaultOptions looking like:
Any ideas?
The text was updated successfully, but these errors were encountered: