What I'm trying to do is generate a path in Pathauto using the hierarchy of a taxonomy term. Essentially, if my content belongs to Term 1 > Term 2 > Term 3, then my path should be term-1/term-2/term-3/content. I'm using the title module to replace the name field.
This works fine, when editing content in the same language as the page. What doesn't seem to work is editing content in a different language. For example, if (using Entity Translation), I attempt to translate the English content using the French backend (or vice versa), I get the wrong parent terms (but the right term and content). Trying to import content using Migrate in both languages at once has the same problem.
I tracked this down to the function token_taxonomy_term_load_all_parents($tid). When taxonomy_get_parents_all($tid) is called, it loads the parents in the current language and nothing is being done to translate the labels of those terms.
The ideal solution (I think) is that this should be entity_label('taxonomy_term', $term, $langcode); and $langcode should come from $options['language'] from the tokens_tokens() call. This runs into the problem ofthough, which prevents title_entity_label() from using the $langcode parameter and probably doesn't let i18n_taxonomy play with it either. Alternatively, we could hack it for now (either reimplement entity_label with a $langcode parameter OR detect if title replacement is enabled and call the callback directly (as well as some solution for using i18n_taxonomy's method to fix the string as well)).
I kindof need this, so I'm willing to put in some work and submit patches where needed, I'm just not really sure on which direction to take to get this ironed out for now.
FAILED: [[SimpleTest]]: [MySQL] 347 pass(es), 0 fail(s), and 2 exception(s).
[ View ]
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch title-module-friendly-terms-2033419-1.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]