Tokens for a fields are not saved as Default values but instead the substituted text is saved

Created on 5 January 2017, about 8 years ago
Updated 10 October 2024, 4 months ago

I'm running Drupal 8.2.4.
I have a content type with a Link type field. I would like the link text to be the current user name by default and the URL to point to the current user account page. I put [current-user:display-name] as the text default value and [current-user:url:path] as the URL default value.
Without the Field Default Token installed the token substitution does not happen at all - the nodes are created with unprocessed tokens in the link text and URL. I install the Field Default Token and the strangest thing happens: as I save the default values, the tokens are evaluated and replaced at this very moment: MY user name and a link to MY account are saved as default values, so that when any user cretes a node, they get MY name and link in the Link field instead of theirs. Surely it's not supposed to work this way?

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇷🇺Russia marassa Moscow

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024