Hello,
I have custom account profile fields added at admin/config/people/accounts/fields
First Name - field_firstname - Text field
Last Name - field_lastname - Text field
Then as part of a content type, I added the two fields to the content type from the existing fields list. For the default value in these fields, I used
First Name - field_firstname - Text field / Default Value: [current-user:field_firstname]
Last Name - field_lastname - Text field / Default Value: [current-user:field_lastname]
When I go to add new content to the content type, the First and Last Name fields are blank. This tells me that at least a token replace is trying to work, as it isn't just the token showing up as the default value. Any ideas or thoughts on this?
Image #3 is the 'add new content' form.
This behavior is present in both current releases. As a proof of concept test, [current-user:uid] did work correctly. The form fields were populated with my UID's.
Comment | File | Size | Author |
---|---|---|---|
#9 | fielddefaulttoken1.png | 70.6 KB | Pafla |
#1 | field_token_replacement_1.png | 31.25 KB | drewbe121212 |
#1 | field_token_replacement_2.png | 52.51 KB | drewbe121212 |
#1 | field_token_replacement_3.png | 4.46 KB | drewbe121212 |
#6 | TokenReplacement_MissingName.png | 21.82 KB | drewbe121212 |
Comments
Comment #1
drewbe121212 CreditAttribution: drewbe121212 commentedComment #2
drewbe121212 CreditAttribution: drewbe121212 commentedComment #3
drewbe121212 CreditAttribution: drewbe121212 commentedComment #4
maximpodorov CreditAttribution: maximpodorov commentedDo you really have this field for the current user (and it's not empty)? Could you try [current-user:field-lastname] instead of [current-user:field_lastname]?
Comment #5
drewbe121212 CreditAttribution: drewbe121212 commentedHi maximpodorov,
I can confirm that the user I am currently logged in has the first name and last name fields filled out.
Using [current-user:field-lastname] did not work.
Comment #6
drewbe121212 CreditAttribution: drewbe121212 commentedComment #7
Pafla CreditAttribution: Pafla commentedI made a field in profil (Role) as text type
And choosed "[user:roles]" as default
and saved other is default
But when i go to user/1/edit-profile and users/bruger - the field is empty or hidden
Did i do anything wrong or?
Pafla
Comment #8
maximpodorov CreditAttribution: maximpodorov commented[roles] value is array. What do you expect to see?
Comment #9
Pafla CreditAttribution: Pafla commentedI expect to see "The user roles associated with the user account."
Or does it not work with all token in that list?
See screenshot
Comment #10
maximpodorov CreditAttribution: maximpodorov commentedYou can't see arrays. Could you try another token: [user:roles:first] instead?
Comment #11
Pafla CreditAttribution: Pafla commentedWhen using [user:roles:first] it is still empty.
And when i try to use another token from another field in the profile, it is empty too
Comment #12
drewbe121212 CreditAttribution: drewbe121212 commentedI can also see the token roles replacement if I use the one that implodes the roles [current-user:roles:?] (or something similar, can't remember at the moment).
This seems to be affecting only custom profile fields, but not fields that are provided by the default install.
Comment #13
MrPeanut CreditAttribution: MrPeanut commentedFor what it's worth, custom profile fields are working for me (with the exception of #2212445: How to set taxonomy term reference field). I have set a custom token from my user profile (
[current-user:field_location]
) as the default value for the body and it does show up.Comment #14
maximpodorov CreditAttribution: maximpodorov commentedSo no evident bug exists here.