Active
Project:
Token OR
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Aug 2025 at 11:44 UTC
Updated:
19 Aug 2025 at 15:20 UTC
Jump to comment: Most recent
auto_entitylabel module automatically escapes double quotes (ie. ") effectively not supporting this module.
- 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".
Comments
Comment #2
zaporylieComment #3
zaporylieOne way to support this would be to create a generic, dynamic [fallback_value:*] dynamic token, which will stop relying on the double quotes.
Comment #4
pianomansam commented@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.
Comment #5
zaporylieauto_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 #3380978: Allow to use ' as enclosure for using in href attributes while auto_entitylabel should stop using TranslatableMarkup in favour of having a translatable config entity.