Error when trying to place a new block: RuntimeException: The subform and parent form must contain the #parents property, which must be an array.

Created on 6 August 2024, 4 months ago

Problem/Motivation

Clicking on the "Select entities" button throws the following error instead of opening the entity browser.
RuntimeException: The subform and parent form must contain the #parents property, which must be an array. Try calling this method from a #process callback instead. in Drupal\Core\Form\SubformState->getParents() (line 76 of /Users/maria.mcdowell/Sites/devdesktop/eemmcdowell-test/docroot/core/lib/Drupal/Core/Form/SubformState.php).

Steps to reproduce

  1. Enable layout builder in one content type.
  2. Create a custom block type with an entity reference field and select "Entity Browser - Table" as a field widget in Manage Form.
  3. Create one custom block content using the block type created in step (2)
  4. Apply patch from Re-order + remove broken with the Entity Reference (and File) widget
  5. Try placing the block on the layout build and update the entity reference field selection using Entity browser.

Proposed resolution

Update EntityReferenceBrowserWidget::formElementEntities().

Remaining tasks

User interface changes

NA

API changes

NA

Data model changes

NA

🐛 Bug report
Status

Active

Version

2.0

Component

Widget plugins

Created by

🇮🇳India bunty badgujar Delhi

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

Comments & Activities

Production build 0.71.5 2024