Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Just like as view field, I found it's very useful in some situations.
I think token solution is also an good replace of URL prepopulate.
Comment | File | Size | Author |
---|---|---|---|
Screenshot at 2012-02-03 16:55:08.png | 16.71 KB | rogical |
Comments
Comment #1
jpstrikesback CreditAttribution: jpstrikesback commentedOpened a new issue in the Entity Reference PrePopulate Issue Queue. http://drupal.org/node/1479268
Comment #2
giorgio79 CreditAttribution: giorgio79 commentedI think having a token selector for default values should belong to Entity Reference. :)
Comment #3
Jelle_SThis is a duplicate of an issue with a working patch: #1699378: Allow tokens in entity reference views selection arguments
Comment #4
jcnventura CreditAttribution: jcnventura commentedNo it is not.. Tokens could be used for the default value of the entity reference widgets (select, checkbox and autocomplete) with no need to bring complex views into the problem.
As it is currently, I use tokens in the help field to tell the user what he should type above.. Seems a bit dumb.
Comment #5
jpstrikesback CreditAttribution: jpstrikesback commented@jcnventira, you are totally right.
Comment #6
boabjohn CreditAttribution: boabjohn commentedApologies if I've stumbled into the wrong queue, but I'm still looking for clues to the simple usecase:
1. Create a text field on an ordinary node type
2. Assign a token to the Default Value (eg, [current-user:name] )
3. Save
4. Attempt to create a new node
5. In the node/add form, the token is NOT EXPANDED << that's the problem
Am I in the right place?
Got here via a long route, including a bypass at the poor old email module where there are plenty of baffled people like me:
https://drupal.org/node/1253028
Thanks in advance for a clue (or two?)
JB
Comment #7
rt1729 CreditAttribution: rt1729 commented@boabjohn : Have you found the solution ? 'm trying to the exact same thing you told in #6.. Please let me know if you got it
Comment #8
attisansame here - would like to use a token in the default value field but am having the error "There are no entities matching [token]".
any hints?
Comment #9
attisanfound a working solution:
install:
greets
Comment #10
ainsofs CreditAttribution: ainsofs as a volunteer commentedThe solution that worked for me was to use the field_default_token module and a work around.
1. First install field_default_token
2. Then on your entity reference field use the "select list" widget
3. Then you supply your default token value and save
4. Switch your widget to "autocomplete" and voila!
It worked on Drupal 7.43 with field_default_token 7.x-1.3
Comment #11
pauldolphin CreditAttribution: pauldolphin as a volunteer commented@ainsofs... Thank you very much for posting your solution. I had a situation where I was using an entity reference field to reference a user. I was able to use the process you detailed to have this user entity reference field to pre populate with [current-user:uid].
Weird little workaround... but worked for me. Thanks again!!!