Sonataadminbundle: sonata_type_collection replaces all rows when new is added

Created on 23 Apr 2013  路  4Comments  路  Source: sonata-project/SonataAdminBundle

Hi,

I'm using sonata_type_collection for a one-to-many relationship between Project and Modality. My Modality entity is composed by three choice fields, and each one's choices are determined dynamically based on the value of the previous one. This is done by Ajax, ofc, and by passing the values on configureFormFields when generating the edit form.

The problem is that, whenever I add a new Modality to a Project, the bundle's ajax call replaces the full list of modalities, clearing my dynamic selects. I'm trying to figure out the best way to address this, and I believe it's by passing the form values to the ajax call, and have the Admin classes generate the selects based on the values input by the user.

However, since I'm considering a PR for this, I'd like to know your opinion on this, if there's a better way to solve this, and if you would consider a merge for this.

cheers

bug

Most helpful comment

over 4 years after the original issue... any news on this?

All 4 comments

I'm also experiencing this issue, did you manage to find a workaround?

I just loaded it with all the possible options, and then filter it out using ajax

any update? @ImenAmmar

over 4 years after the original issue... any news on this?

Was this page helpful?
0 / 5 - 0 ratings