diff --git a/core/modules/field/field.module b/core/modules/field/field.module index 822e802..580db0f 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -323,9 +323,6 @@ function field_theme() { * Implements hook_cron(). */ function field_cron() { - // Refresh the 'active' status of fields. - field_sync_field_status(); - // Do a pass of purging on deleted Field API data, if any exists. $limit = variable_get('field_purge_batch_size', 10); field_purge_batch($limit); @@ -420,19 +417,13 @@ function field_cache_flush() { } /** - * Implements hook_rebuild(). - */ -function field_rebuild() { - // Refresh the 'active' status of fields. - field_sync_field_status(); -} - -/** * Implements hook_modules_enabled(). */ function field_modules_enabled($modules) { - // Refresh the 'active' status of fields. - field_sync_field_status(); + // Refresh the 'active' status of any associated fields. + foreach ($modules as $module_name) { + field_associate_fields($module_name); + } } /** @@ -440,23 +431,6 @@ function field_modules_enabled($modules) { */ function field_modules_disabled($modules) { // Refresh the 'active' status of fields. - field_sync_field_status(); -} - -/** - * Refreshes the 'active' and 'storage_active' columns for fields. - */ -function field_sync_field_status() { - // Refresh the 'active' and 'storage_active' columns according to the current - // set of enabled modules. - $all_modules = system_rebuild_module_data(); - $modules = array(); - foreach ($all_modules as $module_name => $module) { - if ($module->status) { - $modules[] = $module_name; - field_associate_fields($module_name); - } - } db_update('field_config') ->fields(array('active' => 0)) ->condition('module', $modules, 'NOT IN')