The function _field_collection_collect_required_elements() recurses through Field Collection items where the field collection is not required and marks all required children elements as optional while the element is being processed. This is done to prevent required fields within an optional field collection from causing validation errors and preventing saving of entities.

However, if an optional field collection contains an Inline Entity Form, then all the required elements within the entity being created are also set to optional: this includes non-optional elements such as the entity title. If a user opens an Inline Entity Form within an optional Field Collection, they can create nodes, taxonomy terms or other objects without title, causing issues in other areas as Drupal expects these entities to always have a title.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MrDaleSmith created an issue. See original summary.

MrDaleSmith’s picture

This patch creates a new alter hook which can allow modules to specify any keys that should not be recursed into when disabling validation within optional Field Collection items.

MrDaleSmith’s picture

Status: Active » Needs review