warning: Invalid argument supplied for foreach() in /var/www/dp6/sites/all/modules/i18n/i18ntaxonomy/i18ntaxonomy.module on line 578.
Fix:
/**
* Implementation of hook_views_pre_view().
*
* Translate table header for taxonomy fields
* //field[i][id] = term_node_1.name, translate table header
* and replace handler for that field
*/
function i18ntaxonomy_views_pre_view(&$view, &$items) {
if (is_array($view->field)) {
$translate = variable_get('i18ntaxonomy_vocabularies', array());
foreach($view->field as $index => $data) {
$matches = array();
if($data['id'] == 'term_node.name') {
// That's a full taxonomy box
$view->field[$index]['handler'] = 'i18ntaxonomy_views_handler_field_allterms';
} elseif(preg_match("/term_node_(\d+)\.name/", $data['id'], $matches)) {
$vid = $matches[1];
if ($translate[$vid]) {
// Set new handler for this field
$view->field[$index]['handler'] = 'i18ntaxonomy_views_handler_field_allterms';
}
}
}
}
}
Comments
Comment #1
jose reyero commentedWell, that was old code.
It won't be in this first release, commented out for now
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.