Regression: block attribute classes end up on block title as well

Created on 18 September 2023, about 1 year ago

Problem/Motivation

The changes in #3349365: Reduce code duplicate that were in the latest release break block title classes on my website.

Steps to reproduce

I applied the patch using Composer to make sure it was from this issue and not from another committed fix.

  1. The block attribute classes for my block: card card--block
  2. The block title attribute classes for my block: fac-prepend fac--regular--calendar-day

Before the update


After the update


The cause

The issue occurs because the code in layout_builder_component_attributes_preprocess_block has

$existing_classes = $variables['attributes']['class'] ?? [];

instead of

$existing_classes = $variables[$attribute_name]['class'] ?? [];

And that copies the classes from the "attributes" to all the others.

Proposed resolution

Create a fix.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
  • Regression

    It restores functionality that was present in earlier versions.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024