Base form ID is wrong for all layout defaults forms

Created on 14 January 2020, almost 5 years ago
Updated 8 March 2024, 10 months ago

Problem/Motivation

Both \Drupal\layout_builder\Form\DefaultsEntityForm and \Drupal\layout_builder\Form\OverridesEntityForm provide a base form ID to allow hook_form_BASE_FORM_ID_alter() implementations to target both of them, in addition to their individual form IDs.

However, DefaultsEntityForm uses the wrong method when generating the base form ID.

Given nodes and users, the respective base form IDs should be:

node_layout_builder_form
node_layout_builder_form
user_layout_builder_form
user_layout_builder_form

They actually are:

node_layout_builder_form
entity_view_display_layout_builder_form
user_layout_builder_form
entity_view_display_layout_builder_form

Proposed resolution

Fix DefaultsEntityForm::getBaseFormId()

Remaining tasks

Write tests

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
Layout builderΒ  β†’

Last updated 2 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States tim.plunkett Philadelphia

Live updates comments and jobs are added and updated live.
  • Blocks-Layouts

    Blocks and Layouts Initiative. See the #2811175 Add layouts to Drupal issue.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

  • πŸ‡³πŸ‡ΏNew Zealand danielveza Brisbane, AU

    This one might be a little disruptive, quite a few instances of the existing ID being used in contrib and likely many more in client projects.

    I suppose thats what CRs are for, I wonder if there is a good way to deprecate the old ID before we change this?

Production build 0.71.5 2024