diff --git a/expire.module b/expire.module index 2860dc86bae80b8502d731295dafbf1f096ad88f..666ff40b352e4d1a864737278397ac2f72bc6f76 100644 --- a/expire.module +++ b/expire.module @@ -139,6 +139,13 @@ function expire_node($node) { if (module_exists('taxonomy') && variable_get('expire_flush_node_terms', EXPIRE_FLUSH_NODE_TERMS)) { // Get old terms from DB $tids = expire_taxonomy_node_get_tids($node->nid); + // Get old terms from static variable + $terms = taxonomy_node_get_terms($node); + if (!empty($terms)) { + foreach ($terms as $term) { + $tids[$term->tid] = $term->tid; + } + } // Get new terms from node object if (!empty($node->taxonomy)) { foreach ($node->taxonomy as $vocab) { @@ -152,7 +159,8 @@ function expire_node($node) { $filenames = array(); foreach ($tids as $tid) { if (is_numeric($tid)) { - $paths['term' . $tid] = 'taxonomy/term/' . $tid; + $term = taxonomy_get_term($tid); + $paths['term' . $tid] = taxonomy_term_path($term); } } }