Cache context not applied for blocks without content

Created on 9 July 2015, about 9 years ago
Updated 25 February 2023, over 1 year ago

Problem/Motivation

When writing a test for #2524082: Config overrides should provide cacheability metadata β†’ it was discovered that cache contexts are not bubbling up correctly for blocks that do not have any content. This is maybe a relic from Drupal 7 where blocks without content were not rendered. However in Drupal 8 the titles are rendered so it is important to bubble up the cacheability metadata.

To replicate this, check the CacheabilityMetadataConfigOverrideIntegrationTest from #2524082: Config overrides should provide cacheability metadata β†’ - a line in the setUp() of that test explicitly adds some content to the test block. If that line is removed the cacheability metadata is not communicated any more and the test fails.

Steps to reproduce

Proposed resolution

Remaining tasks

Patch
Review
Commit

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

9.5

Component
BlockΒ  β†’

Last updated 3 days ago

Created by

πŸ‡§πŸ‡¬Bulgaria pfrenssen Sofia

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024