function field_attach_rename_bundle

×

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/api.elmsln.org/includes/bootstrap.inc).
cis7 field.attach.inc field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new)
cle7 field.attach.inc field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new)
elmsmedia7 field.attach.inc field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new)
icor7 field.attach.inc field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new)
meedjum_blog7 field.attach.inc field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new)
mooc7 field.attach.inc field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new)

Notify field.module that a bundle was renamed.

Parameters

$entity_type: The entity type to which the bundle is bound.

$bundle_old: The previous name of the bundle.

$bundle_new: The new name of the bundle.

Related topics

7 calls to field_attach_rename_bundle()
comment_node_type_update in modules/comment/comment.module
Implements hook_node_type_update().
EntityAPIController::invoke in sites/all/modules/ulmus/entity/includes/entity.controller.inc
Implements EntityAPIControllerInterface.
EntityAPIControllerExportable::invoke in sites/all/modules/ulmus/entity/includes/entity.controller.inc
Overridden to care about reverted bundle entities and to skip Rules.
field_test_rename_bundle in modules/field/tests/field_test.entity.inc
Renames a bundle for test_entity entities.
file_type_save in sites/all/modules/ulmus/file_entity/file_entity.file_api.inc
Updates an existing file type or creates a new one.

... See full list

1 string reference to 'field_attach_rename_bundle'
media_upgrade_file_types_confirm_submit in sites/all/modules/ulmus/media/includes/media.pages.inc
File types migration confirmation page sumit. Executes actual migration.

File

modules/field/field.attach.inc, line 1360
Field attach API, allowing entities (nodes, users, ...) to be 'fieldable'.

Code

function field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new) {
  db_update('field_config_instance')->fields(array('bundle' => $bundle_new))->condition('entity_type', $entity_type)->condition('bundle', $bundle_old)->execute();

  // Clear the cache.
  field_cache_clear();

  // Update bundle settings.
  $settings = variable_get('field_bundle_settings_' . $entity_type . '__' . $bundle_old, array());
  variable_set('field_bundle_settings_' . $entity_type . '__' . $bundle_new, $settings);
  variable_del('field_bundle_settings_' . $entity_type . '__' . $bundle_old);

  // Let other modules act on renaming the bundle.
  module_invoke_all('field_attach_rename_bundle', $entity_type, $bundle_old, $bundle_new);
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.