Remove entity not working inside the form easy admin bundle

982 views Asked by At

I have this code :

{{ form_start(form, {'attr': {'class': 'form-vertical edit-form', 'id': 'new-users-form', 'data-view': 'new'}}) }}
<div class="row">
    <div class="field-group col-xs-12 col-sm-4">
        <div class="box box-default">
            <div class="box-body " id="box-body-_easyadmin_form_design_element_0">
                <div class="row">
                    <div class="col-xs-12 ">
                        <div class="form-group field-text">
                            {{ form_row(form.value, {'attr': {'class': 'form-control' }}) }}
                        </div>
                    </div>
                    <div class="col-xs-12 ">
                        <div class="form-group field-text">
                            {{ form_row(form.comment, {'attr': {'class': 'form-control' }}) }}
                        </div>
                    </div>
                    <div class="col-xs-12 form-actions">
                        <div class="form-group">
                            <div id="form-actions-row">
                                <button type="submit" class="btn btn-primary action-save pull-right">
                                    <i class="fa fa-check"></i> {{ 'general.buttons.confirm'|trans }}
                                </button>
                                <a class="btn btn-danger pull-right action-delete" style="margin-right: 1%" title=""
                                   href="{{ path('admin', {'entity' : 'User', 'action' : 'delete', 'id' : entity.id}) }}" target="_self">
                                    <i class="fa fa-trash-o"></i>
                                    {{ 'general.buttons.delete'|trans }}
                                </a>
                                <a name="list" class="btn btn-secondary pull-right" title=""
                                   href="{{ path('admin', {'entity' : 'User', 'action' : 'list'}) }}" target="_self">
                                    {{ 'general.buttons.back_to_liste'|trans }}
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{{ form_widget(form._token) }}
{{ form_end(form,{'render_rest': false}) }}

Add and Back links works just fine. The only problem is with delete button. When I try to delete I'm redirect to the liste of User entity whitout delete the current User. I don't have any errors. Please help me. Thx in advance

0

There are 0 answers