Tokens and Twig style variables are not replacement with values.
Instead of in the field stores something like that {{current_user->name}} or [current-user:name]
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | business_rules-2980052-18.patch | 1.04 KB | yseki |
| #16 | example.jpg | 139.47 KB | lexsoft00 |
Comments
Comment #2
wombatbuddy commentedTokens and Twig variables also not working in "Show a message" Action.
For instance, if I paste into 'Message' field these tokens:
{{current_user}}
[current-date:short]
then the message display neither date nor user but only these tokens.
Comment #3
wombatbuddy commentedComment #5
yseki commentedHi @wombatbuddy,
The problem was on the Action, Condition and Variable processing. It was not keeping the token replaced values before the recursive call.
Thanks for reporting this issue.
It's committed on dev version.
Comment #6
c.e.a commentedSame problem here.
I have installed the dev version (updated on 9-Jul) and clear all caches.
However, if I paste into 'title' field of a content variable one of these tokens:
{{current_user->name}}
Or
[current-user:name]
then the output display is only these tokens as they are with no value replaced.
Thank you,
Comment #7
c.e.a commentedComment #8
c.e.a commentedAny update yet on this issue ?
[tokens] and {{tokens}} are not being replaced by real values even after using the dev version !!!
See below:
Thank you,
Comment #10
yseki commentedThanks again C.E.A,
Despite the fact the main issue was solved, you are right, the context was not being passed to the token processor, and because of that, the webform title token was not being replaced.
It's on DEV now and by the end of today on ALPHA20.
Comment #11
yseki commentedRegarding the comment #2, {{current_user}} is not the correct way to use the variable. {{current_user}} is the container, you should use one of the following options:
Comment #13
kenton.r commentedIn a message no variable or token render during a "Entity field form alter." There are no errors. Just updated to the latest dev version. Any ideas why variables and tokens would not be processed? The variable from a view does not show at all.
the following are the variables and tokens tested
--------
[url:unaliased:args:1]
{{current_user->name}}
{{url_variable}}
[current-date:html_date]
{{current_series_id_and_uid->title}} --this is from a view that renders as a block on the page correctly
test
-------
They render as following:
------
{{current_user->name}}
{{url_variable}}
2019-03-28
{{current_series_id_and_uid->title}}
test
----------
for "Entity is viewed" it renders as:
------
Test Church
/winston-or
2019-03-28
{{current_series_id_and_uid->title}}
test
------
Comment #14
c.e.a commentedComment #15
c.e.a commentedThe variables are not rendering when used inside "Set values to entity variable", for example try to set the text field of an entity equal to {{url_variable->1}} but you will receive the variable as it is with no processed value being replaced.
Note: Variables are being rendered correctly while used in "Show a message" action.
This is considered a critical bug report and actions must be taken asap.
this issue has been added to #3041221: List of all 'Bug reports' that need immediate support Assigned to: yseki.
Comment #16
lexsoft00 commentedIt works fine for me. Please find the image below as a representation of the test I've done. Could you try a custom variable instead of default variables?
Try to add an empty entity variable with user entity type and user bundle and use it in a "Set values to entity variable" action type.
Comment #17
c.e.a commentedStill have the same problem!
What I am doing in details:
RULE
Entity is viewed
VARIABLE
Custom Empty Entity variable (logged_in_user_empty_entity_variable)
ACTIONS
1) Fetch entity variable by id.
2) Set values to entity variable.
{{url_variable->1}}3) Set entity variable.
All the users url are converted to the path alias using the pathauto module like so:
/user/32=>/my-profile/john-smith/32So logically, when any user will visit his profile, the value of the field (
field_text_from_url) on my profile profile (uid:1) should be equal to:my-profilebut currently all the value is:{{url_variable->1}}Thank you,
Comment #19
yseki commentedHi @C.E.A,
I guess I got the issue. It worked on the scenario you've described.
The fix is already on DEV.
Here is the patch.
Thank you!
Comment #20
colanMarking as fixed for now. Please reopen if there are any problems.
Comment #21
c.e.a commentedThe issue has been fixed and available in the beta-8 release and up.