NULL, ); } /** * Implements hook_entityreference_autofill_detach_ajax(). */ function entityreference_autofill_og_entityreference_autofill_detach_ajax($field_name, $element, $context) { // Do not attach AJAX callback to OG admin fields. if (og_is_group_audience_field($field_name)) { if (isset($context['instance']['field_mode']) && $context['instance']['field_mode'] == 'admin') { return FALSE; } } } /** * Implements hook_entityreference_autofill_target_id_alter(). */ function entityreference_autofill_og_entityreference_autofill_target_id_alter(&$target_id, &$form_state, $context) { // Fetch value from form input array instead of values. if (og_is_group_audience_field($context['field_name'])) { $field_parents = $form_state['triggering_element']['#parents']; $target_id = drupal_array_get_nested_value($form_state['input'], $field_parents); } }