I’m trying to set up a default value programmatically to my field which is in field collection. This has proved quite hard and I cant seem to get around it. Any assistance will be appreciated. This is the code i have tried to far without any success.This field is a select list with different select items. Now i want it to pre-select one of the items.
$field_collect = $form["field_fielc_collection_group"][LANGUAGE_NONE]; foreach ($field_collect as $fielders){ if(is_array($fielders)){ $somethin = $fielders["field_to_set_default"][LANGUAGE_NONE]["#default_value"]; $default_val =array(t('something')); array_push($somethin,$default_val);