I have a form with an entity reference field and I need to add a default value. I've tried
$form['field_op_product']['und'][0]['target_id']['#default_value'] = $product_node->nid;
but, that doesn't work. Any idea on how to do this?
The widget type is "AutoComplete"
'und'
.