Problem/Motivation

  • while adding already existing entities via entity_browser in a reference field no error message is shown / instead an JS error is thrown that prevents opening the entity_browser again

Steps to reproduce

  • Create custom entity_browser -> Modal with view for selection of content entities
  • Create entity reference field in content type with form settings
  • Reference items that could be selected in previously created entity_browser
  • Widget: Inline Entity form complex (Allow users to add existing nodes.)
  • Widget: select created entity browser in the "Entity Browser" select
  • Create new content and try to select existing content via Entity browser
  • Content is added in inline-entity-form table
  • Try adding the same content again via entity_browser
  • Current Behaviour: nothing happens -> JS error in console
  • Expected Behaviour: show form error, that entity was already added to ief

Error: in console

Proposed resolution

  • fix error handling in form and show error, while trying to add an already existing entity

Expected behavior:

I'll attach a patch fixing the issue.

Comments

SteffenR created an issue. See original summary.

steffenr’s picture

StatusFileSize
new37.1 KB
steffenr’s picture

Issue summary: View changes
StatusFileSize
new32.41 KB
steffenr’s picture

StatusFileSize
new886 bytes

Attached a patch fixing the issue.

steffenr’s picture

Issue summary: View changes
steffenr’s picture

Issue summary: View changes
steffenr’s picture

Assigned: steffenr » Unassigned
Status: Active » Needs review
slashrsm’s picture

Status: Needs review » Fixed
Issue tags: +D8Media

Committed. Thanks!

  • slashrsm committed 5cc89d4 on 8.x-1.x authored by SteffenR
    Issue #2781929 by SteffenR: Fix - Adding already existing entities via...

Status: Fixed » Closed (fixed)

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