You are here

function commerce_kickstart_field_default_field_bases_alter in Commerce Kickstart 7.2

Implements hook_field_default_field_bases_alter().

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

File

./commerce_kickstart.profile, line 227

Code

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

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