Add a config action to alter block settings

Created on 5 December 2024, 3 months ago

Problem/Motivation

Currently there isn't a proper way to alter a block's settings in a recipe. A current work around is to use simpleConfigUpdate, but that shouldn't work as blocks provide config entities, not simple config, and may not work forever if #3439713: Should \Drupal\Core\Config\Action\Plugin\ConfigAction\SimpleConfigUpdate::apply() error if it processes a config entity lands.

config:
  actions:
    block.block.gin_primary_local_tasks:
      setRegion: header
      setWeight: -5
      # Blocks should have setSetting(s) config action.
      # We shouldn't use simpleConfigUpdate here as this is not simple config.
      simpleConfigUpdate:
        settings.secondary: true

Steps to reproduce

Proposed resolution

Remaining tasks

Create a config action to alter block settings

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

11.0 🔥

Component

block.module

Created by

🇺🇸United States thejimbirch Cape Cod, Massachusetts

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024