- Issue created by @claudiu.cristea
- Status changed to Needs review
7 months ago 8:59am 26 April 2024
I have a case when I want to postpone the save of entities after the enclosing form entity is saved. I have some good reasons for that, like I want to store a reverse reference in the IEF entity. I'm using a custom handler that just does nothing in the InlineFormInterface::save()
method to avoid the IEF entity being saved in this stage. But ReferenceUpgrader::registerEntity()
enforces a saved entity with ID.
Why?
I don't see any reason why this is enforced. If entities don't have IDs we should avoid registering and, later, the reference for those entities will not be created, allowing 3rd-party code (like mine) to deal with this.
Don't register entities with no ID.
Alternative solutions (but needlessly more complex!):
ReferenceUpgrader
swappable (maybe convert to a service?)None.
None.
More relaxed approach, allowing more for 3rd-party
None.
Needs review
3.0
Code