function field_sync_field_status

Refreshes the 'active' and 'storage_active' columns for fields.

Related topics

4 calls to field_sync_field_status()
field_cron in drupal/core/modules/field/field.module
Implements hook_cron().
field_modules_disabled in drupal/core/modules/field/field.module
Implements hook_modules_disabled().
field_modules_enabled in drupal/core/modules/field/field.module
Implements hook_modules_enabled().
field_rebuild in drupal/core/modules/field/field.module
Implements hook_rebuild().

File

drupal/core/modules/field/field.module, line 504
Attach custom data fields to Drupal entities.

Code

function field_sync_field_status() {

  // Refresh the 'active' and 'storage_active' columns according to the current
  // set of enabled modules.
  $modules = module_list();
  foreach ($modules as $module_name) {
    field_associate_fields($module_name);
  }
  db_update('field_config')
    ->fields(array(
    'active' => 0,
  ))
    ->condition('module', $modules, 'NOT IN')
    ->execute();
  db_update('field_config')
    ->fields(array(
    'storage_active' => 0,
  ))
    ->condition('storage_module', $modules, 'NOT IN')
    ->execute();
}