This feature doesn't work for widget : inline entity form - Complex

Created on 5 September 2023, over 1 year ago

Problem/Motivation

The field cardinality module doesn't work for Inline Entity form : Complex widget , only works for autocomplete widget

Steps to reproduce

Change the form display mode of entity reference to inline entity complex form mode

Proposed resolution

The module should show consistent behavior across all form widgets

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia shreya shetty

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

Merge Requests

Comments & Activities

  • Issue created by @shreya shetty
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States devkinetic

    Yes you are correct there is no field widget defined for IEF. You can try to create the file in the src folder and extend the existing widget. It's probably a lot like the others.

    With that said I will create a branch for the work. But one thing I wanted to do was configure tugboat so it's easier to develop for all. I will try and do that tomorrow so we can get a test environment setup.

  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Somoshri

    I have created a patch for the same.

  • First commit to issue fork.
  • Merge request !12Created MR From #5. โ†’ (Open) created by chaitanyadessai
  • Status changed to Needs review 11 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mlncn Minneapolis, MN, USA

    Thisโ€ฆ does it, but Inline Entity Form Complex isโ€ฆ complex. It does not seem to be a good idea to take into this module the burden of keeping up with its 1,400 line formElement method.

    Is there precedent for third-party modules choosing to take Field Config Cardinality into account if the module is enabled and a bundle-specific cardinality is configured? Issues where this was explained to maintainers? Examples of what that code looks like?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mlncn Minneapolis, MN, USA

    I've done this integration for IEF Complex Open Widget โ†’ here: โœจ Integrate with Field Config Cardinality Active

    Replacing this line:

        $cardinality = $this->fieldDefinition->getFieldStorageDefinition()->getCardinality();
    

    with:

        $config_cardinality = $this->fieldDefinition->getThirdPartySetting('field_config_cardinality', 'cardinality_config');
        $cardinality = isset($config_cardinality) ? (integer) $config_cardinality : $this->fieldDefinition->getFieldStorageDefinition()->getCardinality();
    
Production build 0.71.5 2024