fix: #3637868 Keep an autocreated entity in an entity reference sub-field

Skip the push back in CompoundField::mirrorColumnOntoSubField() when the sub-field item already holds the column's value. FieldProxy::setValue() mirrors a NULL target_id onto its column, and pushing it back ran the item's onChange('target_id'), which reset an unsaved (autocreated) entity, so the new entity was lost and the item dropped.

CompoundFieldUnsavedReferenceTest covers a new item with an unsaved term and an unsaved term replacing an existing reference. It fails without the change.

Closes #3637868

Merge request reports

Loading
Loading