function field_delete_instance


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 field_delete_instance($instance, $field_cleanup = TRUE)
cle7 field_delete_instance($instance, $field_cleanup = TRUE)
elmsmedia7 field_delete_instance($instance, $field_cleanup = TRUE)
icor7 field_delete_instance($instance, $field_cleanup = TRUE)
meedjum_blog7 field_delete_instance($instance, $field_cleanup = TRUE)
mooc7 field_delete_instance($instance, $field_cleanup = TRUE)

Marks a field instance and its data for deletion.


$instance: An instance structure.

$field_cleanup: If TRUE, the field will be deleted as well if its last instance is being deleted. If FALSE, it is the caller's responsibility to handle the case of fields left without instances. Defaults to TRUE.

Related topics

6 calls to field_delete_instance()
field_attach_delete_bundle in modules/field/
Notify field.module the a bundle was deleted.
field_delete_field in modules/field/
Marks a field and its instances and data for deletion.
field_ui_field_delete_form_submit in modules/field_ui/
Form submission handler for field_ui_field_delete_form().
media_update_7016 in sites/all/modules/ulmus/media/media.install
Convert Media entities to File entities.
og_uninstall in sites/all/modules/ulmus/og/og.install
Implements hook_uninstall().

... See full list


modules/field/, line 768
Field CRUD API, handling field and field instance creation and deletion.


function field_delete_instance($instance, $field_cleanup = TRUE) {
  // Mark the field instance for deletion.
  db_update('field_config_instance')->fields(array('deleted' => 1))->condition('field_name', $instance['field_name'])->condition('entity_type', $instance['entity_type'])->condition('bundle', $instance['bundle'])->execute();

  // Clear the cache.

  // Mark instance data for deletion.
  $field = field_info_field($instance['field_name']);
  module_invoke($field['storage']['module'], 'field_storage_delete_instance', $instance);

  // Let modules react to the deletion of the instance.
  module_invoke_all('field_delete_instance', $instance);

  // Delete the field itself if we just deleted its last instance.
  if ($field_cleanup && count($field['bundles']) == 0) {



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.