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

Embed collection forms with multiple save buttons #1922

Closed
cabsil opened this issue Nov 10, 2017 · 5 comments
Closed

Embed collection forms with multiple save buttons #1922

cabsil opened this issue Nov 10, 2017 · 5 comments

Comments

@cabsil
Copy link

cabsil commented Nov 10, 2017

I have an Entity A which has a many to many association to Entity B. I want to use embedded form to create B entities on the same form. I followed the solution explained here : https://stackoverflow.com/questions/40007362/symfony-easyadmin-one-to-many-form.

I succeeded but when I am adding a new B entity, one save button is added together with a "back to listing" link.

image

This is happening only when I am adding B entity on a new A entity or when I am updating a A entity without any B entity. The behaviour is much better when I update a A entity with a least one B entity.

image

Is this the normal behaviour or is this an issue ?

@cabsil
Copy link
Author

cabsil commented Nov 12, 2017

I analyzed the problem further and found the reason why I got the save button.

In bootstrap_3_layout.html.twig, we have the following code block :
{% block form_rest %} {{- parent() -}} {% if form.parent is empty %} <div class="row"> <div class="col-xs-12 form-actions"> <div class="form-group"> <div id="form-actions-row"> {{- block('item_actions') -}} </div> </div> </div> </div> {% endif %} {% endblock form_rest %}

It looks like the condition {% if form.parent is empty %} doesn't return the same result in case of creating a new A Entity as editing an existing A Entity with at least one B Entity.

@javiereguiluz
Copy link
Collaborator

@cabsil thanks for reporting! I recently merge two bug fixes related to this but I haven't released a stable version yet. Could you please check if they solve this issue for you? Thanks!

@cabsil
Copy link
Author

cabsil commented Nov 12, 2017

That's good news. Thanks.

Well I am quite new to symfony. Could you tell how I can update the easy admin bundle to test you fixes ?

@cabsil
Copy link
Author

cabsil commented Nov 12, 2017

I finally modified the bootstrap layout according to #1915 and it was enough to solve my problem.

When do you plan to release a version ?

@javiereguiluz
Copy link
Collaborator

I'm closing this issue because we're starting a new phase in the history of this bundle (see #2059). We've moved it into a new GitHub organization and we need to start from scratch: no past issues, no pending pull requests, etc.

I understand if you are angry or disappointed by this, but we really need to "reset" everything in order to reignite the development of this bundle.

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

2 participants