Problem
Two related symptoms show up when Layout Builder Kit (LBK) block plugins are used as regular blocks placed via /admin/structure/block:
1. A PHP warning is logged once per LBK block row when viewing /admin/structure/block: Warning: Undefined array key "label" in Drupal\block\Entity\Block->label()
2. Saving any block config entity for an LBK block plugin from that page fails with a "missing schema" error, because there was no config schema definition for the LBK plugin block settings.
Root cause
LBKBaseComponent::baseConfigurationDefaults() builds the block plugin's default configuration array but omits the 'label' and 'label_display' keys that Drupal core's Block config entity and Block::label() expect to always be present. Because these components render their own heading from 'title'/'display_title', the keys were dropped instead of being defaulted, which trips Block::label() when it unconditionally reads settings['label'].
Separately, there was no config/schema/layout_builder_kit.schema.yml coverage for the per-plugin block.settings.* keys LBK blocks use, so config schema validation fails ("missing schema") when a block config entity for an LBK plugin is saved from the block layout UI.
Proposed fix
- Restore 'label' => '' and 'label_display' => '0' in LBKBaseComponent::baseConfigurationDefaults(), matching the pattern core uses for FieldBlock, ExtraFieldBlock and PageTitleBlock (label_display '0' so core does not also render the label, since LBK components render their own heading).
- Add block_settings schema plus per-plugin block.settings.* schema definitions to config/schema/layout_builder_kit.schema.yml so saving LBK block config entities validates correctly.
- Add an update hook (update_10002()) to backfill label/label_display onto already-saved LBK block config entities, so sites upgrading do not need to re-save every block manually.
- Add kernel test coverage for both the default configuration values and the update hook backfill behavior.
Issue fork layout_builder_kit-3616800
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
Comment #2
aangel commented/do:fork
Comment #3
aangel commented