sonata-project/SonataAdminBundle — pull request #433 by merk (2011-12-01 11:32:07+00:00)
Title: Fix assignment of correct Admin class

I have been having problems with the creation of certain associations when configured as a non null relationship (For example, a comment that MUST have a post before being saved to the database).

The URL generated when clicking the little add icon does not take you to the child admin instance, rather the admin instance that is not associated with a parent (which, ultimately I'd like to be able to not use - I have no need of a non associated child admin class - it NEEDS a parent).

I've traced the problem to the function in this pull - in every case, the related FieldDescription is assigned the unassociated child admin class, when IMO it should be assigned the child admin class.

I am unsure if this is an appropriate fix, but since it fixes the problem I've encountered - I hope it can at least start a discussion about the issue.