Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#6 | 2833328-allow-markup.patch | 1.28 KB | cr0ss |
#2 | token-bubbleable-metadata-2833328-2.patch | 1.13 KB | Berdir |
Comments
Comment #2
BerdirComment #4
BerdirI think this can't be tested as it still works due to automatic bubbling. assuming that we're in a normal render context.
Comment #6
cr0ss CreditAttribution: cr0ss as a volunteer and commentedThis 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?