Does not currently support field_collection module.

The only problem I see is in cck_select_other_widget_validate()

Change:

elseif (!empty($reversed) && isset($form_state['field']['#parents'])) {
    // Profile 2 exception.
//    $container = array_shift($reversed);
//    $field = $form_state['field']['#parents'][$container]['#fields'][$field_name];
//    $values = &$form_state['values'][$container];
    
    // MY CHANGE
    // We aren't using Profile 2 but are using field collections so will make that work here instead
    $container_delta = array_shift($reversed);
    $container_langcode = array_shift($reversed);
    $container = array_shift($reversed);
    
    $field = $form_state['field']['#parents'][$container][$container_langcode][$container_delta]['#fields'][$field_name];
    $values = &$form_state['values'][$container][$langcode][$delta];
    
  }

I don't have profile 2 installed right now so can't develop a way to make them both work but maybe check if container is numeric. If it is numeric, it is in fact the container's delta followed by it's language then field name. If, when using profile 2, the container name is the last element of $reversed perhaps could use array_pop to get the container name then load the field with field_info_field() to see how to proceed.

Comments

mradcliffe’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Active » Fixed

Fixed in 7.x-2.x branch with rewrite of element parent handling.

Sarenc’s picture

The new version works great - Thanks!!

mradcliffe’s picture

Thank you for the feedback.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.