- Issue created by @plach
The Media Widget → module, which defines media reference field widgets mimicking core's File upload and Link widgets, includes an ugly hack (see here and here) to work around a problem happening when submitting the entity form with an existing media item.
When creating a new media item, the submission will work just fine, since the entity reference field supports automatically saving new referenced entities, however it does not currently support re-saving existing referenced entities. As a consequence, when submitting the entity form, if any media field value was updated (e.g. if the "alt" media field value was changed), there is no way for the save to happen as part of referencing entity save transaction. This in turn means that, if either the referencing entity save or the media entity save fail, an inconsistent state can result.
Add support to optionally re-save a referenced entity when saving the referencing entity.
Validate the proposed solution
Write code
Perform reviews
None
None
None, only API additions
None
TBD
Active
11.1 🔥
field system
Enhances an existing API or introduces a new subsystem. Depending on the size and impact, possibly backportable to earlier major versions.