diff --git a/modules/taxonomy/taxonomy.install b/modules/taxonomy/taxonomy.install index 7649795..db281af 100644 --- a/modules/taxonomy/taxonomy.install +++ b/modules/taxonomy/taxonomy.install @@ -939,7 +939,7 @@ function taxonomy_update_7011(&$sandbox) { */ /** - * Add unpublished nodes to the taxonomy index table. + * Add entity_revision_is_default nodes to the taxonomy index table. */ function taxonomy_update_7012(&$sandbox) { if (!isset($sandbox['total'])) { @@ -958,12 +958,20 @@ function taxonomy_update_7012(&$sandbox) { // Build the taxonomy index for each node. foreach ($nids as $nid) { $node = node_load($nid); - taxonomy_build_node_index($node); + $isDefaultRevision = $node->status; + if (module_exists('entity')) { + $entity_type = 'node'; + $entity = entity_load($entity_type, array($node->nid)); + $isDefaultRevision = (int) entity_revision_is_default($entity_type, $entity); + } + if($isDefaultRevision) { + taxonomy_build_node_index($node); + } $sandbox['last'] = $node->nid; } $sandbox['count'] += $batch_size; } - // Finish after all the unpublished nodes have been processed. + // Finish after all the unpublished and entity_revision_is_default nodes have been processed. if ($sandbox['count'] < $sandbox['total']) { $sandbox['#finished'] = FALSE; }