EasyAdminExtensionBundle
EasyAdminExtensionBundle copied to clipboard
Embedded list shows everything if manytomany is empty
Hi,
I have an issue with my embedded list which is between my classes Intern & Internships which is a ManyToMany relationship.
When an internship has at least one intern, it works fine and we can see it in the embedded list. However, if my internship has no interns my embedded list shows every intern in my database.
I tried to debug it by looking into the embeddedListAction and I do not know if this is supposed to happen.
When looking at the $paginator variable in embeddedListAction I can see that when I have atleast one intern the query is :
"SELECT entity FROM App\Entity\Intern entity LEFT JOIN entity.person person WHERE entity.id IN (:form_filter_entity_id) ORDER BY entity.id DESC"
But if there are no intern in my internship the query changes to :
"SELECT entity FROM App\Entity\Intern entity ORDER BY entity.id DESC"
Is that an issue with my configuration or does embeddedListAction not support ManyToMany completely ?
Hi @DylanKas,
I understand why the WHERE has disappeared, this is limitation of IN operator in query builder. But I don't understand why the LEFT JOIN part is removed too. Did you override something about the list query builder ?
No, there shouldn't be any kind of override on this query. That's why i'm kinda surprised it does that.
I also tried to add an ext_filters: {'entity.internships': 'form:parent.data.id'}
but that doesn't seems to work at all. It does not use it.
Also encountered this problem. Is a solution planned?
Same problem for me... This Bundle is amazing, but this is annoying :)