diff -u b/modules/field/field.module b/modules/field/field.module --- b/modules/field/field.module +++ b/modules/field/field.module @@ -363,6 +363,7 @@ * Purges some deleted Field API data, if any exists. */ function field_cron() { + field_sync_field_status(); $limit = variable_get('field_purge_batch_size', 10); field_purge_batch($limit); } @@ -415,11 +416,18 @@ } } - /** * Implements hook_flush_caches(). */ function field_flush_caches() { + field_sync_field_status(); + return array('cache_field'); +} + +/** + * 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(); @@ -438,8 +446,6 @@ ->fields(array('storage_active' => 0)) ->condition('storage_module', $modules, 'NOT IN') ->execute(); - - return array('cache_field'); } /** only in patch2: unchanged: --- a/modules/taxonomy/taxonomy.test +++ b/modules/taxonomy/taxonomy.test @@ -360,7 +360,6 @@ class TaxonomyVocabularyUnitTest extends TaxonomyWebTestCase { $this->field_name = drupal_strtolower($this->randomName() . '_field_name'); $this->field = array('field_name' => $this->field_name, 'type' => 'text', 'cardinality' => 4); $this->field = field_create_field($this->field); - $this->field_id = $this->field['id']; $this->instance = array( 'field_name' => $this->field_name, 'entity_type' => 'taxonomy_term', @@ -370,6 +369,7 @@ class TaxonomyVocabularyUnitTest extends TaxonomyWebTestCase { field_create_instance($this->instance); module_disable(array('taxonomy')); + drupal_flush_all_caches(); require_once DRUPAL_ROOT . '/includes/install.inc'; drupal_uninstall_modules(array('taxonomy')); module_enable(array('taxonomy'));