Token field - Cache metadata not applied to render array. (context/views issue) - issue with render context maybe?

Created on 1 October 2020, over 4 years ago
Updated 27 December 2023, over 1 year ago

Problem/Motivation

DS Token field doesn't apply the token replace metadata to the render array - only current render context.

For some services such as context module - the metadata is required to bubble in the render array.

Motivation: As a site builder I don't want to ensure the same UUID of content block on staging / production (core block layout could be used if same UUID used), so I use a view to find the any content block I want to display.

Steps to reproduce

If a content block using display suite layout with token field is displayed using views block and rendered conditionally using the context module - the cache metadata applied to the render context is ignored. (e.g. current user's username token, update to name are ignored)

Works / not work:

  • Condition context module, display is a view block - show content block - BROKEN
  • Condition block layout (core), display is a view block - show content block - WORKS
  • Condition context module, display is a content block - WORKS
  • Condition block layout (core), display is a content block - WORKS

Proposed resolution

Solution: Add metadata to render array. (works in all cases)

Backwards compatibility: Themers may be already rendering the value directly outside a render array without issue, so we still apply meta data to render context consistent and current token replace implementation.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Postponed

Version

3.0

Component

Code

Created by

🇦🇺Australia silverham

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