function field_info_cache_clear

Clears the field info cache without clearing the field data cache.

This is useful when deleted fields or instances are purged. We need to remove the purged records, but no actual field data items are affected.

Related topics

23 calls to field_info_cache_clear()
CustomBlockTypeTest::testCustomBlockTypeEditing in drupal/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTypeTest.php
Tests editing a block type using the UI.
EntityTranslationSettingsTest::testSettingsUI in drupal/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationSettingsTest.php
Tests that the settings UI works as expected.
FieldInfoTest::testFieldInfo in drupal/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php
Test that field types and field definitions are correctly cached.
FieldInfoTest::testFieldInfoCache in drupal/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php
Tests that the field info cache can be built correctly.
FieldInfoTest::testFieldPrepare in drupal/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php
Test that cached field definitions are ready for current runtime context.

... See full list

File

drupal/core/modules/field/field.info.inc, line 32
Field Info API, providing information about available fields and field types.

Code

function field_info_cache_clear() {
  drupal_static_reset('field_view_mode_settings');
  drupal_static_reset('field_available_languages');

  // @todo: Remove this when field_attach_*_bundle() bundle management
  // functions are moved to the entity API.
  entity_info_cache_clear();
  _field_info_collate_types_reset();
  Field::fieldInfo()
    ->flush();
}