Problem/Motivation

When using tokens that very by user, date or something like that, the block is cached without considering the relevant cache contexts/tags.

Proposed resolution

Use the bubbleable metadata to attach it to the render array.

Remaining tasks

Check if other token replacements need to be updated too, tests

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir created an issue. See original summary.

Berdir’s picture

  • Berdir committed a3b68cc on 8.x-1.x
    Issue #2833328 by Berdir: Handle bubbleable metadata for block title...
Berdir’s picture

Category: Bug report » Task
Status: Needs review » Fixed
Issue tags: -Needs tests

I think this can't be tested as it still works due to automatic bubbling. assuming that we're in a normal render context.

Status: Fixed » Closed (fixed)

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

cr0ss’s picture

FileSize
1.28 KB

This looks good and works as expected with one problem - we don't have markup now and for a bunch of blocks it makes sense to have
for example.

I'm attaching patch just to hear if this solution and bring any problems?