The problem is that Twig template variables that implement either
CacheableDependencyInterface (i.e. they carry cacheability metadata to bubble) or
AttachmentsInterface (i.e. they carry attachments to bubble) don't have their metadata bubbled. Twig just uses their strings, and that's it.
Just before actually using/printing these Twig template variables, do the necessary bubbling, much like we do in
Patch. Manual testing.
- Test coverage.
User interface changes
Data model changes