I'm using entity translation, title, and pathauto together on our site. My path pattern is for a term is: [term:parents:join-path]/[term:name]

When saving a taxonomy term with children, the child terms url alias is updated incorrectly.

For instance, if I have the following:

(English terms)
product/booklet/title1
product/booklet/title2
product/booklet/title3

I translate the "product" term to Spanish, then click save.

I now get:
producto/folletos/title1
producto/folletos/title2
producto/folletos/title3

Unfortunately, this tags the new entries in the URL_alias table with language 'en', no matter what interface I'm using to save it.

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

tomdisher created an issue. See original summary.

tomdisher’s picture

It seems like the pathauto taxonomy updates children terms without a language associated.

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);
    }
  }

Perhaps someone with a bit more working knowledge can comment - would it be a problem to specify the language code when updating the children?

if (!empty($options['alias children'])) {
    // For all children generate new aliases.
    $langcode = pathauto_entity_language('taxonomy_term', $term);
    $options['language'] = $langcode;
    foreach (taxonomy_get_children($term->tid, $term->vid) as $subterm) {
      pathauto_taxonomy_term_update_alias($subterm, $op, $options);
    }
  }
tomdisher’s picture

istavros’s picture

This is what I use in version 7.x-1.3 and it works