- Issue created by @DhruvR
When using the Webform Inline Entity Form module, if an Inline Entity Form field is placed inside a Custom Composite field (which allows for the "Add more" functionality to add additional rows), an error occurs when trying to add more rows. The error message is:
InvalidArgumentException: The inline_entity_form #default_value property must be an entity object. in Drupal\inline_entity_form\Element\InlineEntityForm::processEntityForm() (line 99)
This issue arises specifically when clicking the "Add more" button to dynamically add additional rows containing the Inline Entity Form field. The issue does not occur during form submission, but only when trying to add new rows dynamically.
#default_value
property for the Inline Entity Form field to a valid entity object (either an existing entity or a new one to be created).InvalidArgumentException: The inline_entity_form #default_value property must be an entity object. in Drupal\inline_entity_form\Element\InlineEntityForm::processEntityForm() (line 99)
The issue likely stems from the Inline Entity Form not correctly handling the #default_value
property when placed inside a Custom Composite field with the "Add more" functionality.
#default_value
is recognized as a valid entity object when a new row is added dynamically using the "Add more" feature.#default_value
is being passed and processed when new rows are dynamically added.No UI changes are expected, but users will benefit from the ability to dynamically add new rows containing the Inline Entity Form field without encountering errors.
There are no expected API changes, but there may be improvements in how the #default_value
property is handled for Inline Entity Form fields inside composite fields.
No data model changes are anticipated. However, if a solution involves changes to how entities are initialized or passed to Inline Entity Form fields, this may impact the entity data structure when using the Add more functionality.
Active
1.0
Code