Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug - Fields not mapped are lost accross steps #400

Open
fdiedler opened this issue Mar 8, 2022 · 0 comments
Open

Bug - Fields not mapped are lost accross steps #400

fdiedler opened this issue Mar 8, 2022 · 0 comments

Comments

@fdiedler
Copy link

fdiedler commented Mar 8, 2022

Hi,

After investigating, all fields in the current step that are not mapped (attribut mapped => false) are lost if I click on "previous" button.

Example with only 2 steps (the not mapped field is located at step 1) :

class PropertyContractType extends AbstractType
{
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'label' => false,
            'data_class' => PropertyContract::class,
        ]);
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if ($options["flow_step"] == 1)
        {
            // Step 1
            $builder
                ->add('step1Field', ChoiceType::class, [
                    'choices' => ['....'],
                ])
                ->add('invoiceMin', TextType::class, [
                    'label' => 'Field not mapped',
                    'mapped' => false,
                ])
            ;
        }
        else
        {
            // Step 2
            $builder
                ->add('step2Field', TextType::class)
            ;
        }
    }
}

The invoiceMin data is available at step 2 (in the request object because not mapped to the entity) but if I press "previous" button, the invoiceMin data is lost.

Is it a bug or something that I don't understand ?

NB : This issue refers to this one #399

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant