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 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

TBD

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Comments

zaporylie created an issue. See original summary.

zaporylie’s picture

Issue summary: View changes
pianomansam’s picture

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.