8000 [Profiler][Forms] Adding to form after ->createForm() leads to an exception in Profiler · Issue #20872 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Profiler][Forms] Adding to form after ->createForm() leads to an exception in Profiler #20872

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

Closed
vudaltsov opened this issue Dec 11, 2016 · 1 comment

Comments

@vudaltsov
Copy link
Contributor

I have a controller with the following code:

$form = $this
    ->createForm(SurveyType::class, $survey)
    ->add('submit', SubmitType::class, [
        'label' => 'Create',
    ]);

When I go to the profiler, it throws an exception Key "type_class" for array with keys "id, name, view_vars, children" does not exist in @WebProfiler/Collector/form.html.twig at line 460.

So adding elements to the created form (not form builder) leads to this problem.

Btw, is it a bad practice to add buttons (specific for controller action) in such a manner? I know that a can use inherit_data for the SurveyType, but it does not allow to have DATA events, which I do use in this particular case.

@javiereguiluz
Copy link
Member

@vudaltsov thanks for reporting this issue. It looks like a duplicate of #20823 which has already been fixed in the 3.2 branch and it will be available in the upcoming 3.2.1.

Regarding the question about buttons, the Symfony Best Practices book mentions this in http://symfony.com/doc/current/best_practices/forms.html#form-button-configuration and you can always ask others in the support channels shown in https://symfony.com/support Thanks!

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

No branches or pull requests

3 participants
0