function field_sync_field_status

7.x field.module 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-7.x/modules/field/field.module
Implements hook_cron().
field_flush_caches in drupal-7.x/modules/field/field.module
Implements hook_flush_caches().
field_modules_disabled in drupal-7.x/modules/field/field.module
Implements hook_modules_disabled().
field_modules_enabled in drupal-7.x/modules/field/field.module
Implements hook_modules_enabled().

File

drupal-7.x/modules/field/field.module, line 423
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();
}