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

Do not lose _route_params #7211

Merged
merged 2 commits into from May 25, 2021
Merged

Conversation

VincentLanglet
Copy link
Member

Subject

I am targeting this branch, because bugfix.

This is an attempt to fix #7185

Changelog

### Fixed
- childId are not lost anymore when using multiple times the appendFormFieldAction and similar actions.

@VincentLanglet
Copy link
Member Author

How do i have the app variable in tests @sonata-project/contributors ?

@@ -39,13 +39,13 @@ This code manages the one-to-many association field popup
'elementId': id,
'objectId': sonata_admin.admin.root.id(sonata_admin.admin.root.subject),
'uniqid': sonata_admin.admin.root.uniqid,
'subclass': app.request.query.get('subclass'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not needed anymore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already inside the app.request.query.all value.

@franmomu
Copy link
Member

One question, would it be enough to generate the id, childId, etc parameters from the admin and attach them (with an extension or something as you said at the beginning)? or not because they are not the same?

My concern is about adding parameters that are not really needed.

@VincentLanglet
Copy link
Member Author

One question, would it be enough to generate the id, childId, etc parameters from the admin and attach them (with an extension or something as you said at the beginning)? or not because they are not the same?

It would be enough for my case.

My concern is about adding parameters that are not really needed.

Yes I understand. But thinking about it, I was wondering "What is a not needed parameter ?"
For instance, you could have some specific logic about the query parameters in your admin class (which is already the case with persistent parameters). So since all the query params could be used in your admin class to have a specific behavior, I didn't find this as a bad idea to keep them all.

@VincentLanglet VincentLanglet merged commit 2cce28c into sonata-project:3.x May 25, 2021
@VincentLanglet VincentLanglet deleted the fixRequest branch May 25, 2021 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AppendFormField loses parent admins.
3 participants