You are here

function commerce_kickstart_field_default_field_instances_alter in Commerce Kickstart 7.2

Implements hook_field_default_field_instances_alter().

Helper alter to aid in Features Override of Features 1.x override exports of Fields and Field Instance config.

File

./commerce_kickstart.profile, line 248

Code

function commerce_kickstart_field_default_field_instances_alter(&$fields) {
  if (module_exists('features_override')) {
    $possible_alters = commerce_kickstart_get_fields_default_alters();
    drupal_alter('field_default_fields', $possible_alters);
    foreach ($possible_alters as $identifier => $field_default) {

      // Check if the alter added a field instance value.
      if (!isset($field_default['field_instance']) || !isset($fields[$identifier])) {
        continue;
      }
      $fields[$identifier] = drupal_array_merge_deep($fields[$identifier], $field_default['field_instance']);
    }
  }
}