function file_type_delete

×

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 file_entity.file_api.inc file_type_delete($type)
cle7 file_entity.file_api.inc file_type_delete($type)
elmsmedia7 file_entity.file_api.inc file_type_delete($type)
icor7 file_entity.file_api.inc file_type_delete($type)
meedjum_blog7 file_entity.file_api.inc file_type_delete($type)
mooc7 file_entity.file_api.inc file_type_delete($type)

Deletes a file type from the database.

This function can be called on its own, or via the CTools exportables 'delete callback' for {file_type} objects.

Parameters

object|string $type: Either a loaded file type object or the machine-name of the type.

Related topics

4 calls to file_type_delete()
file_entity_type_delete_confirm_submit in sites/all/modules/ulmus/file_entity/file_entity.admin.inc
Process file type delete confirm submissions.
file_entity_type_revert_confirm_submit in sites/all/modules/ulmus/file_entity/file_entity.admin.inc
Process file type delete confirm submissions.
file_entity_uninstall in sites/all/modules/ulmus/file_entity/file_entity.install
Implements hook_uninstall().
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.
2 string references to 'file_type_delete'
file_entity_schema in sites/all/modules/ulmus/file_entity/file_entity.install
Implements hook_schema().
file_entity_update_7201 in sites/all/modules/ulmus/file_entity/file_entity.install
Add the {file_type}, {file_type_mimetypes} tables.

File

sites/all/modules/ulmus/file_entity/file_entity.file_api.inc, line 568
API extensions of Drupal core's file.inc.

Code

function file_type_delete($type) {
  $type = is_string($type) ? file_type_load($type) : $type;

  db_delete('file_type')->condition('type', $type->type)->execute();

  // Remove this type from CToolS status variable.
  $status = variable_get('default_file_type', array());
  unset($status[$type->type]);
  variable_set('default_file_type', $status);

  file_info_cache_clear();

  // After deleting from the database, check if the type still exists as a
  // code-provided default type. If not, consider the type fully deleted and
  // invoke the needed hooks.
  if (!file_type_load($type->type)) {
    field_attach_delete_bundle('file', $type->type);
    module_invoke_all('file_type_delete', $type);
  }
}
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.