You are here

function field_update_7002 in Drupal 7

Split the all-inclusive field_bundle_settings variable per bundle.

Related topics

File

modules/field/field.install, line 451
Install, update and uninstall functions for the field module.

Code

function field_update_7002() {
  $settings = variable_get('field_bundle_settings', array());
  if ($settings) {
    foreach ($settings as $entity_type => $entity_type_settings) {
      foreach ($entity_type_settings as $bundle => $bundle_settings) {
        variable_set('field_bundle_settings_' . $entity_type . '__' . $bundle, $bundle_settings);
      }
    }
    variable_del('field_bundle_settings');
  }
}