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

Error messages displayed twice with form type "sonata_type_native_collection" and "error_bubbling" sets to false #2761

Closed
fancyweb opened this issue Mar 5, 2015 · 7 comments · May be fixed by #8208

Comments

@fancyweb
Copy link
Contributor

fancyweb commented Mar 5, 2015

Admin class :

protected function configureFormFields(FormMapper $formMapper)
{
    $formMapper
        ->add('aliases', 'sonata_type_native_collection', array(
            'type' => 'text',
            'error_bubbling' => false
        ));
}

If validation fails for the field "aliases", the error message will be shown twice.

The first time comes sonata_type_native_collection_widget (https://github.com/sonata-project/SonataAdminBundle/blob/master/Resources/views/Form/form_admin_fields.html.twig#L230), the second time from form_row (https://github.com/sonata-project/SonataAdminBundle/blob/master/Resources/views/Form/form_admin_fields.html.twig#L200).

I think we have to delete the call to form_errors in the sonata_type_native_collection_widget because sonata_type_native_collection_widget is called from form_row.

@core23
Copy link
Member

core23 commented Aug 13, 2016

This issue is very old. Can you please check this against the latest master version?

Feel free to close if you don't use this bundle anymore or the issue is fixed.

@nadrshin
Copy link

nadrshin commented Jun 6, 2017

I use sonata-project/admin-bundle 3.16.0. This bug has not been fixed yet.

@Gasjki
Copy link
Contributor

Gasjki commented Nov 1, 2017

Did anyone found any solution for this problem ?

@nadrshin
Copy link

nadrshin commented Nov 1, 2017

@ketamina96, add this code to form theme:

{% block sonata_type_native_collection_errors %}
    {% if form.rendered %}
        {{ form_errors(form) }}
    {% endif %}
{% endblock %}

@Gasjki
Copy link
Contributor

Gasjki commented Nov 2, 2017

@nadrshin it doesn't work. It still shown twice.

@stale
Copy link

stale bot commented Jan 31, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix label Jan 31, 2020
@SonataCI SonataCI removed the wontfix label Jan 31, 2020
@core23 core23 added the stale label Feb 6, 2020
@sad270
Copy link
Contributor

sad270 commented Aug 29, 2024

Hello, i have same issue on SonataAdminBundle 4.31.0

Screenshot 2024-08-29 at 16 37 40

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