Generate unique wrapper id for complex widget

Created on 7 January 2022, almost 3 years ago
Updated 5 September 2023, over 1 year ago

Problem/Motivation

If multiple IEF complex widgets exist on the same page, then ajax calls will default to the 1st widget .

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States xdong

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.2 & MySQL 8
    last update over 1 year ago
    Patch Failed to Apply
  • Status changed to Needs work over 1 year ago
  • 🇺🇦Ukraine podarok Ukraine

    needs reroll

    git apply 3257479-6.patch 
    error: patch failed: inline_entity_form.module:117
    error: inline_entity_form.module: patch does not apply
    error: patch failed: src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php:819
    error: src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php: patch does not apply
    
  • First commit to issue fork.
  • Assigned to bharath-kondeti
  • 🇮🇳India bharath-kondeti Hyderabad

    I will reroll the changes and update the patch. I will also raise a MR.

  • @bharath-kondeti opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India bharath-kondeti Hyderabad

    Rerolled the patch for 2.0.x. Raised an MR for the same. Please review

  • Status changed to Needs work over 1 year ago
  • 🇺🇦Ukraine podarok Ukraine
    git apply 3257479-12.patch 
    3257479-12.patch:104: trailing whitespace.
      
    error: patch failed: src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php:278
    error: src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php: patch does not apply
    
  • Status changed to Fixed over 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Status changed to Fixed over 1 year ago
  • 🇮🇹Italy luca_cracco

    I'm having a problem with this change.

    The ID (in getWrapperId method) is recalculated on every interaction with the form (ex. Ajax), in my case when the inline-entity-form throws a validation error of some field. Once corrected the value and re-submitted the form is not closed, I think because the unique id is recalculated in subsequent calls (no button between "create" or "cancel" works).

    For a quick test you can create an "entity-reference" field that uses the "inlineEntityForm Complex" widget. The referenced entity must have some validation, such as a required field.
    When creating the related entity try to throw error, correct and save the inline-entity-form.

    Rolling back the change (or static id assignment like in the previous version) solves the problem.

  • 🇮🇳India Megha_kundar

    Hi @luca_cracco I have fixed this issue https://www.drupal.org/project/inline_entity_form/issues/3383346 🐛 Can't save the content without reloading if you miss the required fields once Postponed: needs info in this ticket please review

Production build 0.71.5 2024