Block admin page token help text provides wrong token

Created on 6 March 2025, 6 months ago

Problem/Motivation

When on the block layout edit page for my block I get a token that is structured [block_token:ctools_block:block_name] but when I am editing content and look at the token replacement pattern the actual (working) token is [block_token:system:block_name].

Steps to reproduce

Edit a block on the edit page and check the token string provided.
Then edit a piece of content with a text filter that allows for block token replacements and check the replacement patterns.
Notice the difference.

Proposed resolution

Remove the help text on the block admin page since it is providing wrong information. The replacement patterns is right where the editors need it so this should be enough for them to work with.

Remaining tasks

Remove the block form admin code found here: https://git.drupalcode.org/project/block_token/-/blob/8.x-1.x/block_toke...

User interface changes

Removes incorrect help text.

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ccjjmartin Austin, TX

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ccjjmartin
  • Status changed to Needs work 22 days ago
  • πŸ‡¬πŸ‡§United Kingdom james.williams

    The replacement pattern can be wrong simply because of module dependencies, even those for visibility conditions. See #3099693-3: Custom block Token Not render β†’ . e.g. If your block has a user role condition, then the token has to start [block_token:user:! Perhaps it would be better to just remove/ignore the module name in the token, since the block ID is already unique? But that might break backwards-compatibility too as content might start showing that wasn't previously showing.

Production build 0.71.5 2024