What I am doing wrong? The error says:
Fatal error: Call to a member function advanced_render() on a non-object in /var/www/mydrupalsite/themes/myTheme/template.php on line XXXX
/**
* Overrides theme_views_view_field for a view
*
*/
function myTheme_views_view_field($view, $field, $row) {
//Work only for mobile view and section field
if($view->name == 'mobile' && $field->options['label'] == 'Section') {
$new_items = array();
foreach($field->items as $skey => $subitem) {
$new_items[$skey] = array();
foreach($subitem as $key => $item) {
$parent = taxonomy_get_parents($key);
if(count($parent) == 0){
//do not set item in items, if taxonomy does not have parent
}
else {
$new_items[$skey][$key] = $item;
}
}
}
//Assign new items list to field items
$field->items = $new_items;
return $field->advanced_render($row);
} else {
return $field->advanced_render($row);
}
}