Problem/Motivation

This is a regression introduced in 1.0.0-rc2, affecting block preprocessing when the enhanced UI is enabled.

When the enhanced UI is enabled, BlockComponentRenderArray::onBuildRender() moves the original block content from content to content['component'] before hook_preprocess_block() runs.

Block preprocessors therefore receive a different content structure, which can break logic that accesses or modifies its child elements and properties.. This can make the IPE preview differ from the normal page. For example, preprocessing that adjusts the order or placement of a block’s content may no longer work as expected in the editing preview.

Steps to reproduce

  1. Enable Layout Builder IPE and Enhance the default Layout Builder UI.
  2. Add a block with a named child such as comment.
  3. Read or move that child in hook_preprocess_block().
  4. Compare the normal page with the IPE editing preview. The child is direct content normally, but nested under content['component'] in IPE.

Proposed resolution

Add the enhanced before/after controls through a theme wrapper on the outer, uncacheable preview component, leaving the block content unchanged. This preserves preprocessing, render caching and lazy builders. JavaScript positions the controls inside their owning block, keeping them hidden until positioned to avoid layout shifts.

Remaining tasks

Review and test MR !11.

Review and test the patch on the supported Drupal versions.

User interface changes

None intended.

API changes

None.

Data model changes

None.

Command icon 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

berliner created an issue. See original summary.

berliner’s picture

Status: Active » Needs review
berliner’s picture

Issue summary: View changes
berliner’s picture

Issue summary: View changes
berliner’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

berliner’s picture

Released as part of 1.0.0-rc3.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.