function content_clear_type_cache in Content Construction Kit (CCK) 5
Same name and namespace in other branches
- 6.3 content.module \content_clear_type_cache()
- 6 content.module \content_clear_type_cache()
- 6.2 content.module \content_clear_type_cache()
Clear the cache of content_types; called in several places when content information is changed.
19 calls to content_clear_type_cache()
- content_admin_display_overview_form_submit in ./
content_admin.inc - content_admin_field_overview_form_submit in ./
content_admin.inc - content_copy_import_form_submit in ./
content_copy.module - Submit handler for import form. For each submitted field: 1) add new field to the database 2) execute the imported field macro to update the settings to the imported values
- content_field_instance_delete in ./
content_crud.inc - Delete an existing field instance.
- content_types_rebuild in ./
content_crud.inc - Rebuild content type information from node tables.
File
- ./
content.module, line 881 - Allows administrators to associate custom fields to content types.
Code
function content_clear_type_cache() {
// If type type cache needs to be cleared because type information has
// changed, the cached node values also need to be emptied so they
// don't carry stale values.
// TODO see if there is a less destructive way to do this.
cache_clear_all('*', 'cache_content', TRUE);
_content_type_info(TRUE);
if (module_exists('views')) {
// Needed because this can be called from .install files
include_once './' . drupal_get_path('module', 'views') . '/views.module';
views_invalidate_cache();
}
}