You are here

function bundle_inherit_field_delete_instance in Bundle Inherit 7

Implements hook_field_delete_instance().

File

./bundle_inherit.module, line 96
Bundle Inherit module.

Code

function bundle_inherit_field_delete_instance($instance) {
  $children = bundle_inherit_bundle_get_children($instance['entity_type'], $instance['bundle']);
  foreach ($children as $bundle) {
    $new_instance = $instance;
    $new_instance['bundle'] = $bundle['type'];
    $new_instance['locked'] = FALSE;
    try {
      field_update_instance($new_instance);
    } catch (Exception $e) {
      drupal_set_message($e
        ->getMessage(), 'error');
    }
  }
}