compatibility with auto_entitylabel

Created on 19 August 2025, 23 days ago

Problem/Motivation

auto_entitylabel module automatically escapes double quotes (ie. ") effectively not supporting this module.

Steps to reproduce

- enable auto_entitylabel and token_or modules
- create auto_entitylabel token pattern and utilize token_or fallback string, ex. [node:tags|"Tag"]
- see that if field tags don't have a value, the token will result in an empty string. Expacted output is "Tag".

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡³πŸ‡΄Norway zaporylie

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

Comments & Activities

  • Issue created by @zaporylie
  • πŸ‡³πŸ‡΄Norway zaporylie

    One way to support this would be to create a generic, dynamic [fallback_value:*] dynamic token, which will stop relying on the double quotes.

  • πŸ‡ΊπŸ‡ΈUnited States pianomansam

    @zaporylie Sorry to hear about this issue. Thanks for reporting it. I'll look into how auto_entitylabel implements token replacement. If there's a way we can resolve it on that side, we would avoid a breaking change on the token_or side. In the meantime, you're welcome to submit a fix.

  • πŸ‡³πŸ‡΄Norway zaporylie

    auto_entitylabel module uses tokens within TranslatableMarkup's placeholder ('@placeholder'), which is what's causing this issue in the first place.

    If we add support for an alternative fallback string dynamic replacement token we could leave the old logic in place but document how to use new syntax, gradually deprecating old syntax.

    Currently, I solved it like that in the project's custom codebase, and this solution is working well. Whitespaces are supported in case that's someone's concern.

    Please also notice that a similar issue was created in auto_entitylabel module, link in Related issues.

    IMHO both modules could benefit from improvements: token_or could stop relying on quotes which would also resolve ✨ Allow to use ' as enclosure for using in href attributes Postponed: needs info while auto_entitylabel should stop using TranslatableMarkup in favour of having a translatable config entity.

Production build 0.71.5 2024