- last update
about 1 year ago Patch Failed to Apply
This is a follow-up for β¨ Deep serialization for content entities to make an exact snapshot of an entity object's structure based on its current state Needs work to make the form cache store the deeply serialized entity in case a widget for nested/inline entity forms is being used by the form display.
We need this in order not to loose changes made on inline referenced entities. Currently core has the behavior that when a new field item is appended because of WidgetBase::addMoreSubmit the form object will be cached and as part of it the entity having the values from the new field item. However if you are dealing with inline references, then the changes will be lost and in some cases there is even no workaround possible.
This is not only a task / feature request, but also a bug report. There is a similar issue - π Inconsistent form build between initial form generation and the first ajax request Needs work which should use deep serialization to ensure the referenced entities are the same on the first ajax call as during the initial form build and this issue here should ensure that the entities are the same between subsequent ajax calls.
In ContentEntityForm::setFormDisplay()
check if the provided form display uses a widget that is flagged to require entity deep serialization and if so in ContentEntityForm::__sleep()
flag the entity for deep serialization.
Write Patch, Review & Commit.
None.
ContentEntityFormInterface:: isEntityDeepSerializationRequired() to check if the entity from the form object has to be serialized deeply. This might be used by custom/contrib modules and will be used by the autosave_form module to check if the entity has to be deeply serialized instead of implementing the whole check over again.
None.
Postponed
11.0 π₯
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.