Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #2
bojanz CreditAttribution: bojanz at Centarro commentedThis got fixed since (extractFormValues checks if it's in a submit or a validate)