Alter hook not applied for block content if the block is reusable

Created on 5 August 2023, 11 months ago
Updated 6 August 2023, 11 months ago

Problem/Motivation

When using reusable blocks in layout builder, the form alter hook is not fired. This is caused by the code below:

function _block_form_alter_block_plugin_form_alter_invoke(array &$form, FormStateInterface &$form_state, string $plugin) {
  if ($plugin == 'block_content' || $plugin == 'inline_block') {
    return;
  }

We return early for "block_content" plugins, but in block_form_alter_form_alter we only check for the inline_block plugin.

Proposed resolution

Also fire the hook for block_content plugins.

Remaining tasks

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands seanB Netherlands

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

Comments & Activities

Production build 0.69.0 2024