I have nodes with required term reference field. But "add term path" action add 0 crumbs because of my node hase 'ru' language, but term_field has 'und'. Additionally the field array in node object contains only tid.

I'm newbe in Drupal 7 and not sure that my decision is correct, but its works for me:
This code in hansel_taxonomy.module (rows 58-59):

          if (isset($term_field[$node->language])) {
            foreach ($term_field[$node->language] as $term) {

should be changed to:

          if (isset($term_field[$node->language]) || isset($term_field['und'])) {
            foreach ((isset($term_field[$node->language])? $term_field[$node->language]: $term_field['und']) as $term) {
              if (!isset($term['taxonomy_term'])) $term['taxonomy_term'] = taxonomy_term_load($term['tid']);
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

prima.werefox’s picture

I made new module to work with taxonomy in hansel. It use token api to translate terms and have some fixes to processing taxonomy fields in nodes.

kernel32ddl’s picture

I made new module to work with taxonomy in hansel. It use token api to translate terms and have some fixes to processing taxonomy fields in nodes.

It work! Thank you so much!

mayar’s picture

It work!
Спасибо, greenmother!

mauritsl’s picture

Status: Active » Fixed

Changes from original post were commited to GIT. Thanks!

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

guy_schneerson’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Status: Closed (fixed) » Active

this is not working for me (using the dev version) i did however manage to get it working with a modified patch for the same issue http://drupalcode.org/project/hansel.git/blobdiff/c32f7b5e97bab8b84fcfc9...

having a look now to try and understand the different approaches and will post a patch if relevant

guy_schneerson’s picture

Title: hansel_taxonomy.module doesn't work in localized Drupal » hansel_taxonomy.module doesn't work in localized Drupal when viewing nodes
Status: Active » Closed (fixed)

OK got it (i think) this is when viewing nodes and my issue is when viewing a taxonomy page will rename this issue and start a new one

guy_schneerson’s picture

Status: Closed (fixed) » Active
FileSize
1.3 KB

The patch cycles all fields that have widget implemented by taxonomy or options, however that includes other fields not only taxonomy once.
it then references the 'tid' that doesn't exist for fields that are not taxonomy and raises pages of errors in the watchdog log.
the patch checks that the 'tid' exists before using it.