EasyCorp / EasyCorp/EasyAdminBundle
Inside a FieldConfigurator defined on an associated CollectionField's entity, $entityDto->getInstance() returns NULL
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 4.3k
- Forks
- 1.1k
- Avg merge
- 8d 2h
- Merged PRs (30d)
- 11
Description
CRUD of entity "A" includes a CollectionField of entities "B". I'm trying to define a FieldConfigurator on B's fields. When I modify an entity of type "A" which has some associated "B"s, the configurator is correctly called also on B's fields: inside the "supports" method $entityDto->getFqcn() == B::class returns true, and $field->getProperty() returns their names, but $entityDto->getInstance() always returns null.
If instead I define the configurator on A, $entityDto->getInstance() correctly returns the instance, but I don't know how to access B's Fields and EntityDtos from there, to configure them.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing FieldConfigurator's supports method when it is invoked for fields inside a CollectionField, then inspect how EntityDto instances are populated for the associated B entity. Reproduce the A/B CRUD case described in the issue and determine the expected way to access B's instance or fields; done when the behavior or supported access path is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, symfony
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100