I have a taxonomy vocabulary with our locations as terms. User profiles have a term reference field to select which location they work at. I am now creating a content type with a field for the location (also a term reference field). This module is being used to automatically set the location from the current user's profile.

For some reason, setting [current-user:field_location] as the default for the term reference field does not work.

If I set it as the default for the body, it does work (meaning it's not #2200825: Unable to access token from custom field on profile?). I'm not using autocomplete so it's not related to #2194803: Taxonomy terms reference autocomplete widget broken either.

Comments

MrPeanut’s picture

Status: Active » Closed (works as designed)

Well that was a quick fix on my end. :) The solution was to enable Entity Tokens via Entity and use the token [current-user:field-location:tid] so that I'm using the term ID instead of the term name.

Donit’s picture

@MrPeanut How did you use term reference as a regular text field without autocomplete?

MrPeanut’s picture

@Donit — Sorry, after 3.5 years, I forget which project this was, but I think I was using either the Check boxes/radio buttons or Select list widget.

Donit’s picture

I see, thanks, MrPeanut. I am having trouble using tokens in a autocomplete field for a term reference. My goal is to insert there automatically the node author name. Do you have a solution in mind?

gaurangagg’s picture

@Donit - Did you solve this problem? I am stuck at this exact problem!

Donit’s picture

@gaurangagg - Not with Field default token. But there are two other module options that you can choose: Entity Reference Prepopulate with Entity Reference Prepopulate Token OR Prepopulate.