Handle update and delete of Block component config entities

Created on 30 October 2024, 5 months ago

Overview

Block components have config entities for each plugin created automatically on cache clear. However, block plugins that do not exist do not have components deleted, nor are existing block component config entities updated once they have been created.

Proposed resolution

Delete block component config entities once the plugin (or derivative) no longer exists.
Decide when and how to update block component config entities when changes occur.

User interface changes

📌 Task
Status

Active

Version

0.0

Component

Config management

Created by

🇬🇧United Kingdom longwave UK

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

Comments & Activities

  • Issue created by @longwave
  • 🇬🇧United Kingdom longwave UK
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    👍

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    This should add \Drupal\Tests\experience_builder\Kernel\Plugin\ExperienceBuilder\ComponentSource\BlockComponentTest and test — by for example deleting a Menu config entity, which will result in \Drupal\system\Plugin\Derivative\SystemMenuBlock deriving one fewer block.

    I bet there will be config dependency-related challenges 😇 In fact … I see that the necessary config dependencies are missing currently. For example:

    uuid: 784eab71-dbfa-49da-b932-dc703a5de2f8
    langcode: en
    status: true
    dependencies: {  }
    label: 'Administration block'
    id: block.system_menu_block.admin
    provider: system
    source: block
    category: Menus
    settings:
      plugin_id: 'system_menu_block:admin'
      default_settings:
        id: 'system_menu_block:admin'
        label: Administration
        label_display: ''
        provider: system
        level: 1
        depth: 0
        expand_all_items: true
    

    😱

    That

    dependencies: {  }
    

    should be

    dependencies:
      config:
        - system.menu.admin
    

    That is an oversight in bug when Block support was first added in 📌 Add support for Blocks as Components Active .

Production build 0.71.5 2024