Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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']);
Comment | File | Size | Author |
---|---|---|---|
#8 | taxonomy_localized_drupal_tid_bug_1265386_8.patch | 1.3 KB | guy_schneerson |
#1 | hansel_taxonomy_translate.zip | 2.15 KB | prima.werefox |
Comments
Comment #1
prima.werefox CreditAttribution: prima.werefox commentedI 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.
Comment #2
kernel32ddl CreditAttribution: kernel32ddl commentedIt work! Thank you so much!
Comment #3
mayar CreditAttribution: mayar commentedIt work!
Спасибо, greenmother!
Comment #4
mauritsl CreditAttribution: mauritsl commentedChanges 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.
Comment #6
guy_schneerson CreditAttribution: guy_schneerson commentedthis 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
Comment #7
guy_schneerson CreditAttribution: guy_schneerson commentedOK 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
Comment #8
guy_schneerson CreditAttribution: guy_schneerson commentedThe 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.