Add support for inline entity form field widget (paragraphs)

Created on 31 July 2024, 5 months ago
Updated 1 August 2024, 5 months ago

Problem/Motivation

Currently, the module does not provide support for complex fields like paragraphs. Ideally, it will be good to provide support for that.

Steps to reproduce

1. Install the module
2. Install & enable the module paragraphs
3. Install & enable the module inline_entity_form
3. Add a new paragraph type and attach it as a reference field to a node for ex. basic page
4. Make that paragraph type as translatable here /admin/config/regional/content-language. Configure the option Enable inline translation as must have
5. Go to the paragraph Manage form display and set the form widget as Inline entity form - Simple
6. Go to the edit/add basic page norm form.
7. The paragraph field won't show up or will be broken

Proposed resolution

Write a proper support for it as it's missing.

Remaining tasks

1. There are still issues with the field cardinality unlimited. The "Add another item" button works for the default field widget so, the translated fields from other tabs inherit the original field form state.
2. The radio "Delete item" does work properly for the Inline entity form - Simple but not for Inline entity form - Complex. We need to provide some more support for deletion there.

User interface changes

1. To make sure the inline entity form widget for the paragraphs reference field will be the same as for simple fields, so, the UI should be inherited
2. Provide the possibility to add new elements if cardinality is unlimited

API changes

None.

Data model changes

None.

💬 Support request
Status

Needs work

Version

1.0

Component

Code

Created by

🇲🇩Moldova andrei.vesterli Chisinau

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

Comments & Activities

  • Issue created by @andrei.vesterli
  • 🇨🇦Canada swickham

    Testing context: A paragraph field for products called field_related_items that is a paragraph type consisting of a textfield field_header and a required field that allows unlimited product references called field_products_reference

    Issues found while testing:

    • If you want to add a related item for one language but not for the other, validation will stop you for not filling out the product field in the language w/o the product since it's a required field
    • You cant delete an item if the required field for it (the product reference in this case) isn't filled out
    • If you leave a required field unfilled for a language, and that language isn't the current tab selected, when you submit the form it won't submit but you don't see the validation error
    • The Related Items field now has a paragraph automatically added to be filled in so when i edit the product I cant save the form due to the fields being required even though I didn't want to add any
    • Inconsistent validation: when I add a new Related Items group it won't let me add a new product field before filling in the first one. After filling in the first one I can add as many empty ones as I want
    • Can't add more product lines on the second language than the primary language
    • If you choose the "delete item" option to get rid of a field you added by accident before it has ever been saved to the entity you get an error
  • 🇲🇩Moldova andrei.vesterli Chisinau

    Additional patch update

Production build 0.71.5 2024