Curently the entity is being saved in the field widget's function InlineEntityFormMultiple::extractFormValues which is being called during the parent entity is being newly built by ContentEntityForm::buildEntity, which is being called during validation and submit.

The problem is that if the validation fails, the referenced entity will be regardless saved.

So saving the entity should not occur during parent entity form validation, but during submit only.

Comments

hchonov created an issue. See original summary.

bojanz’s picture

Status: Active » Closed (duplicate)

This got fixed since (extractFormValues checks if it's in a submit or a validate)