EasyCorp / EasyCorp/EasyAdminBundle

Inside a FieldConfigurator defined on an associated CollectionField's entity, $entityDto->getInstance() returns NULL

Open
#7,188 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.