Problem/Motivation

A button that validates nothing, like UI Patterns' source selector toggle #3528205: Performance: On-demand lazy-loading source selector, rebuilds the Config form with its own value and nothing else. ContextualFormPanel::alterFormValues() takes those values as the source's settings, so the stored source is replaced by the button entry.

A field source then loses its derivable_context, the form comes back shaped differently, and the row the button sits in is gone. UI Patterns fatals on the refresh: ComponentFormBase::announceValues(): Argument #1 ($row) must be of type array, null given.

Steps to reproduce

  • Create content type article with field reference taxonomy Tags
  • Enable Display Builder for this entity full display
  • Open /admin/structure/types/manage/article/display/full/display-builder.
  • Add/click the Tags field in the Canvas, open its Config, then the Variant box.
  • Click Configure: the row does not open, and the error above is in the JS console and in watchdog.

Proposed resolution

Drop the triggering element's own value before treating a rebuild's values as source settings. Kernel test covers both cases: a rebuild carrying only the button keeps the stored source, one carrying form values still updates it.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mogtofu33 created an issue. See original summary.

mogtofu33’s picture

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.