Custom block Token Not render

Created on 9 December 2019, almost 6 years ago
Updated 13 June 2024, over 1 year ago

Hi

I am facing some caching issues in custom block token. I am using same block token ([block_token:block_content:custom]) in 2
pages (Page1 and Page2) on body field. Page1 this block showing and Page2 this block is not showing . When we clear cache and refresh Page2 , block is showing and check Page1, block is not showing. Again clear cache and refresh Page1 showing block but Page2 block is not showing.

Please suggest.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇮🇳India gauravmysme

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.

  • 🇺🇸United States duckydan

    I am seeing this same behaviour with 1.1.

  • Status changed to Needs work about 1 month ago
  • 🇬🇧United Kingdom james.williams

    Amazingly, this is because block_token matches the 'last' module dependency of a block. For modules that come before block_token alphabetically (such as block_content), that means the suggested token won't work! You can however use the token browser to get a working token; which will be one using 'block_token' in place of 'block_content'. So in your case, that will be [block_token:block_token:custom].

    As suggested in 🐛 Block admin page token help text provides wrong token Active , a solution could be to just remove that incorrect suggestion of the token to use. Or we put a fix in to use the 'right' token, but we'd need to preserve backwards-compatibility. To be honest, I don't think the module name really needs to be part of the token, as the ID on the end should already be unique across all blocks? So we could even just ignore the module name in any existing tokens - though as that's a behaviour change, it might warrant a new major version of the module.

Production build 0.71.5 2024