Hi folks,
I have the following error that cant found in other issues.
Notice: Undefined index: taxonomy_term in i18n_taxonomy_field_formatter_view() (line 218 of /home/..../sites/all/modules/contrib/i18n/i18n_taxonomy/i18n_taxonomy.module).
this happens in node type with term reference fields, in a multilang site (catalan, spanish and galego) when clicking preview button.
I do some debbuing and I solved it as following. In file sites/all/modules/contrib/i18n/i18n_taxonomy/i18n_taxonomy.module arround line 219:
case 'i18n_taxonomy_term_reference_link':
foreach ($items as $delta => $item) {
if ($item['tid'] == 'autocreate') {
$element[$delta] = array(
'#markup' => check_plain($item['name']),
);
}
else {
$term = $item['taxonomy_term'];
.....
add:
case 'i18n_taxonomy_term_reference_link':
foreach ($items as $delta => $item) {
if ($item['tid'] == 'autocreate') {
$element[$delta] = array(
'#markup' => check_plain($item['name']),
);
}
else {
$term = $item['taxonomy_term'];
if($term == NULL) {
if($item['tid'] != NULL) {
$term = taxonomy_term_load($item['tid']);
}
}
Its some similar to this issue: https://drupal.org/node/934726 solved with the patch https://drupal.org/files/934726-89.patch
now for me is working. I hope this will be useful for someone.
cheers.
Comment | File | Size | Author |
---|---|---|---|
#5 | i18n-2092883-5-term field-not displayed.patch | 1.68 KB | geek-merlin |
Comments
Comment #1
paolomainardi CreditAttribution: paolomainardi commentedI confirm this bug.
Comment #2
paolomainardi CreditAttribution: paolomainardi commentedPatch attached.
Comment #4
paolomainardi CreditAttribution: paolomainardi commentedUp
Comment #5
geek-merlinThanks for getting the ball rolling!
This issue is completely parallel to this RTBC sode issue #2128265: Term field not displayed + Notice: Undefined index: taxonomy_term in taxonomy_field_formatter_view() (line 1596 of taxonomy.module).
The patch is on the right track but does not cover all code paths (and does not apply).
Patch flying in copying the approach from the other issue and covering all relevant code paths (only 2 here) using i18n functions.
Added the "not shown" symptom to title & raising prio as a not showing field is surely a "significant repercussion".
Please test so we can get this in.
Comment #6
Nabako CreditAttribution: Nabako commentedPatch worked for me. After applying it; no Notice message displayed anymore.
Comment #7
geek-merlinSo rtbc.
Comment #8
geek-merlinAnother worksforme: Fixed a site that showed a WSOD when viewing a node.
Just for the records, here's the backtrace. (strange that field_view_field did not call field_default_prepare view / taxonomy_field_formatter_prepare_view)
Comment #10
joseph.olstad