Steps to reproduce:
- Install Drupal
- Enable entity_browser_example module
- navigate to /node/add/entity_browser_test
- Open first "Files" details element
- Click on "Select entities" and add few files to the field
- Open second "Files" details element
- Click on "Select entities", dialog opens, add few files
- At this point you have files in both fields
- Move back to the first "Files" details element and click "Remove" for one of the selected files
- Expected result: file is removed from the list
- Actual result: dialog opens and file stays listed

This can happen with any unrelated AJAX request. We found this issue on a form with entity browser widget and IEF: select something in EB, open IEF (AJAX fires), try to remove something from EB, unpredictable result happens.

CommentFileSizeAuthor
#2 2667448_1.patch1.79 KBslashrsm

Comments

slashrsm created an issue. See original summary.

slashrsm’s picture

Title: Field widget can potentially lose information about selected entities in case of unrelated AJAX requests » Field widget can potentially loses information about selected entities in case of unrelated AJAX requests
Status: Active » Needs review
StatusFileSize
new1.79 KB

This patch fixes the problem.

slashrsm’s picture

Title: Field widget can potentially loses information about selected entities in case of unrelated AJAX requests » Field widget can potentially lose information about selected entities in case of unrelated AJAX requests
marcingy’s picture

Status: Needs review » Reviewed & tested by the community

Makes sense from a code review and comments are pretty good as too why it happens :)

slashrsm’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

  • slashrsm committed 48b2710 on 8.x-1.x
    Issue #2667448 by slashrsm, marcingy: Field widget can potentially lose...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.