Inline Entity Form - Simple not available for storage entities referenced via storage entities

Created on 18 August 2023, over 1 year ago

Problem/Motivation

When using storage as a content entry component similar to paragraphs it is nice to decide whether the sub items open by default.
Inline entity form provides two widgets, simple and complex.

When the parent entity is a node we can set inline entity form Simple which leaves the storage entity always open.
When the parent entity is a storage entity complex is the only option.

Steps to reproduce

Proposed resolution

Su\pport simple inline entity form widget

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Closed: duplicate

Version

1.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States nicxvan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @nicxvan
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan
  • Status changed to Closed: duplicate over 1 year ago
  • πŸ‡©πŸ‡ͺGermany mxh Offenburg

    The simple widget plugin's implementation has an Drupal\inline_entity_form\Plugin\Field\FieldWidget\InlineEntityFormSimple::isApplicable method implemented as follows:

    /**
       * {@inheritdoc}
       */
      public static function isApplicable(FieldDefinitionInterface $field_definition) {
        $handler_settings = $field_definition->getSettings()['handler_settings'];
        $target_entity_type_id = $field_definition->getFieldStorageDefinition()->getSetting('target_type');
        $target_entity_type = \Drupal::entityTypeManager()->getDefinition($target_entity_type_id);
        // The target entity type doesn't use bundles, no need to validate them.
        if (!$target_entity_type->getKey('bundle')) {
          return TRUE;
        }
    
        if (empty($handler_settings['target_bundles'])) {
          return FALSE;
        }
    
        if (count($handler_settings['target_bundles']) != 1) {
          return FALSE;
        }
    
        return TRUE;
      }

    So maybe you are either referencing to no Storage type at all or are allowing more than one type? Nevertheless, this is most probably a problem of Inline Entity Form module and not Storage Entities. Closing as duplicate in favor of πŸ› Storage Entities - Simple not available for storage entities referenced via storage entities Active . If for some reason this is actually a problem originated by Storage Entities, feel free to re-open.

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    Ah that's it, I'm referencing more than one type, maybe I'll update the readme on inline entity to clarify that simple won't work for more than one entity type reference

Production build 0.71.5 2024