Timeline for Pre-populate field in content from user profile
Current License: CC BY-SA 3.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 13, 2017 at 12:47 | history | edited | CommunityBot |
replaced http://drupal.stackexchange.com/ with https://drupal.stackexchange.com/
|
|
Oct 19, 2015 at 14:32 | vote | accept | jamboNum5 | ||
Sep 9, 2015 at 11:19 | answer | added | jamboNum5 | timeline score: 1 | |
Sep 7, 2015 at 23:19 | comment | added | othermachines |
Hello and welcome. :) The structure of the field array depends on the type, number of values, etc (inspecting with Devel can be a big help, as @ar7max suggested). You're probably looking at something more along the lines of $form['field_location'][LANGUAGE_NONE][0]['country]['#default_value'] if you are indeed prepopulating with a default value. Cheers -
|
|
Sep 7, 2015 at 23:07 | comment | added | Beebee |
You can also use a similar line to your commented out print_r statement to print the structure of the $form array no? Then you will probably see that you're simply misunderstanding the array structure and putting the value in the wrong place. (I think you're missing the #address element of the array: $form['field_location']['und'][0]['#address']['country'] )
|
|
Sep 7, 2015 at 16:42 | comment | added | notabotsure | You can use Devel module to print structure of unknown object | |
Sep 7, 2015 at 16:01 | review | First posts | |||
Sep 7, 2015 at 16:19 | |||||
Sep 7, 2015 at 15:56 | history | asked | jamboNum5 | CC BY-SA 3.0 |