EasyAdminBundle
EasyAdminBundle copied to clipboard
Use PropertyTypeExtractor for field configurators
#3389
This already works for these specific use cases (meaning that you can actually use these fields with nested properties), but we should probably tackle this issue at a higher level as well - because there still are the metadata
fields in the DTOs that don't work with nested properties.
Not sure what's wrong with the unrelated commits, looks like something weird happened when those where merged?
Just ran into an issue using this with an AssociationField
and a ManyToMany relation, with the property typed as following:
/**
* @ORM\ManyToMany(targetEntity=TariffCatalog::class, inversedBy="tariffs")
* @var Collection|TariffCatalog[]
*/
private Collection $tariffCatalogs;
This will now extract Collection
as the type, and set that as the class
on the EntityType
, which obviously is not correct. Not sure how common this case is, but there should probably be a catch for this at least. I'll try to add a fix or something later.
Temporary solution would be to just use ->setFormTypeOption('class', TargetEntity::class)