Fatal error: Call to a member function advanced_render() on a non-object 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-&gt;name == 'mobile' &amp;&amp; $field-&gt;options['label'] == 'Section') {
    $new_items = array();

    foreach($field-&gt;items as $skey =&gt; $subitem) {
      $new_items[$skey] = array();

      foreach($subitem as $key =&gt; $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-&gt;items = $new_items;

    return $field-&gt;advanced_render($row);
  } else {
    return $field-&gt;advanced_render($row);
  }
}
I think you may have copied that code somewhat from a Drupal 6 version? The only problem is that the pattern for theme function signatures has changed in Drupal 7; only the $vars argument is passed in now, which is an array of named variables for the function:

function myTheme_views_view_field($vars) {
  $view = $vars['view'];
  $field = $vars['field'];
  $row = $vars['row'];

  // ...
}