diff --git a/core/modules/taxonomy/taxonomy.install b/core/modules/taxonomy/taxonomy.install index f774760690..ad46b25b82 100644 --- a/core/modules/taxonomy/taxonomy.install +++ b/core/modules/taxonomy/taxonomy.install @@ -196,6 +196,9 @@ function taxonomy_update_8701(&$sandbox) { $sandbox['last'] = 0; $sandbox['count'] = 0; + // Truncate table to avoid integrity constraint violation errors. + db_truncate('taxonomy_index'); + $query = db_select('node_field_data', 'n') ->condition('n.status', NODE_NOT_PUBLISHED); $sandbox['total'] = $query->countQuery()->execute()->fetchField();