Compatibility with token_or

Created on 19 August 2025, 23 days ago

Problem/Motivation

Hi there, and thanks for a great module.

I am setting up a token replacement pattern with a fallback support. For the fallback support, I am using token_or β†’ module. token_or, for a fallback string, requires (literal) double quotes, which are unfortunately escaped via HTML::escape, automatically applied on @placeholder. Whether this is the only conflicting module is yet to be determined but the

Steps to reproduce

- enable token_or module
- 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

TBD

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

πŸ› Bug report
Status

Active

Version

3.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
  • πŸ‡ΊπŸ‡ΈUnited States pianomansam

    unfortunately escaped via HTML::escape

    From my cursory search through the code, I have not found where this occurs.

    On the token/decode side, the code in question appears to be in the generateLabel() method within src/AutoEntityLabelManager.php.

        $output = $this->token->replace($pattern,
          [$entity_type => $entity],
          ['clear' => TRUE],
          $metadata
        );
    
        // Decode HTML entities, returning them to their original UTF-8 characters.
        $output = Html::decodeEntities($output);
    

    One possible solution would be to execute decodeEntities before the token replacement.

Production build 0.71.5 2024