Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an opportunity to load entity in an embedded form #5712

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from

Conversation

voodooism
Copy link

I encountered a problem where the embedded form entity DTO does not have an instance of the entity. Specifically, this issue occurs in the EasyCorp\Bundle\EasyAdminBundle\Field\Configurator\MoneyConfigurator::getCurrency method.

In my particular case, I have a controller where I render an association field as an embedded form on the create and update pages. This association includes a money field configured as follows:

yield MoneyField::new('targetAmount')
    ->setCurrencyPropertyPath('relation.currency');

However, when the MoneyConfigurator is executed, the field value is null, causing the configuration process to stop at this point:

if (null === $field->getValue()) {
    return;
}

By implementing the suggested changes, it will be possible to improve the field configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant