diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index eb81870..8648c0e 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1712,7 +1712,7 @@ function taxonomy_field_presave($entity_type, $entity, $field, $instance, $langc function taxonomy_field_insert($entity_type, $entity, $field, $instance, $langcode, &$items) { // We maintain a denormalized table of term/node relationships, containing // only data for current, published nodes. - if (variable_get('taxonomy_maintain_index_table', TRUE) && $field['storage']['type'] == 'field_sql_storage' && $entity_type == 'node' && $entity->status) { + if (variable_get('taxonomy_maintain_index_table', TRUE) && ($field['storage']['type'] == 'field_sql_storage' || $field['storage']['type'] == 'mongodb_field_storage') && $entity_type == 'node' && $entity->status) { $query = db_insert('taxonomy_index')->fields(array('nid', 'tid', 'sticky', 'created', )); foreach ($items as $item) { $query->values(array( @@ -1730,7 +1730,7 @@ function taxonomy_field_insert($entity_type, $entity, $field, $instance, $langco * Implements hook_field_update(). */ function taxonomy_field_update($entity_type, $entity, $field, $instance, $langcode, &$items) { - if (variable_get('taxonomy_maintain_index_table', TRUE) && $field['storage']['type'] == 'field_sql_storage' && $entity_type == 'node') { + if (variable_get('taxonomy_maintain_index_table', TRUE) && ($field['storage']['type'] == 'field_sql_storage' || $field['storage']['type'] == 'mongodb_field_storage') && $entity_type == 'node') { $first_call = &drupal_static(__FUNCTION__, array()); // We don't maintain data for old revisions, so clear all previous values