diff --git a/pathauto.module b/pathauto.module index 6305820..f3afd95 100644 --- a/pathauto.module +++ b/pathauto.module @@ -700,7 +700,22 @@ function pathauto_node_insert($node) { * Implements hook_node_update(). */ function pathauto_node_update($node) { - pathauto_node_update_alias($node, 'update'); + global $language_content; + $languages = language_list('enabled'); + $original_language_content = clone $language_content; + try { + foreach ($languages[1] as $langcode => $language) { + $language_content = $language; + drupal_static_reset('token_taxonomy_term_load_all_parents'); + drupal_static_reset('field_language'); + pathauto_node_update_alias($node, 'update', array('language' => $langcode, 'force' => TRUE)); + } + } + finally { + $language_content = $original_language_content; + drupal_static_reset('token_taxonomy_term_load_all_parents'); + drupal_static_reset('field_language'); + } } /** @@ -848,7 +863,22 @@ function pathauto_taxonomy_term_insert($term) { * Implements hook_taxonomy_term_update(). */ function pathauto_taxonomy_term_update($term) { - pathauto_taxonomy_term_update_alias($term, 'update', array('alias children' => TRUE)); + global $language_content; + $languages = language_list('enabled'); + $original_language_content = clone $language_content; + try { + foreach ($languages[1] as $langcode => $language) { + $language_content = $language; + drupal_static_reset('token_taxonomy_term_load_all_parents'); + drupal_static_reset('field_language'); + pathauto_taxonomy_term_update_alias($term, 'update', array('alias children' => TRUE, 'language' => $langcode, 'force' => TRUE)); + } + } + finally { + $language_content = $original_language_content; + drupal_static_reset('token_taxonomy_term_load_all_parents'); + drupal_static_reset('field_language'); + } } /** @@ -917,7 +947,6 @@ function pathauto_taxonomy_term_update_alias(stdClass $term, $op, array $options if (!empty($options['alias children'])) { // For all children generate new aliases. - unset($options['language']); foreach (taxonomy_get_children($term->tid, $term->vid) as $subterm) { pathauto_taxonomy_term_update_alias($subterm, $op, $options); }