1 entityreference.install entityreference_update_1002()

Updates each field instance that references old plugin name "taxonomy-index" to "taxonomy".

File

core/modules/entityreference/entityreference.install, line 79

Code

function entityreference_update_1002() {
  foreach (field_info_fields() as $field_name => $field) {
    // Update the field instance configuration.
    if ($field['type'] == 'entityreference') {
      foreach ($field['bundles'] as $entity_type => $bundles) {
        foreach ($bundles as $bundle) {
          $instance = field_info_instance($entity_type, $field_name, $bundle);
          if (isset($instance['settings']['behaviors']['taxonomy-index'])) {
            $instance['settings']['behaviors']['taxonomy'] = $instance['settings']['behaviors']['taxonomy-index'];
            unset($instance['settings']['behaviors']['taxonomy-index']);
            field_update_instance($instance);
          }
        }
      }
    }
  }
}