Cache tags added to build are overwritten by Layout Builder

Created on 26 February 2024, 10 months ago
Updated 3 May 2024, 8 months ago

Problem/Motivation

Cache tags for the selected styles are added to the block build array in BlockComponentRenderArraySubscriber, but Layout Builder overwrites them in SectionComponent::toRenderArray().

Steps to reproduce

Set a breakpoint in SectionComponent::toRenderArray() on return $output and inspect $output['#cache']['tags']. The config:layout_builder_styles.style tag isn't in the array because they are overwritten by the line $event->getCacheableMetadata()->applyTo($output);.

Proposed resolution

Add the tags to $event->getCacheableMetadata().

πŸ› Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States karlshea Minneapolis πŸ‡ΊπŸ‡Έ

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