diff --git a/views_field_view_handler_field_view.inc b/views_field_view_handler_field_view.inc index 3cd6a3f..3c22e18 100644 --- a/views_field_view_handler_field_view.inc +++ b/views_field_view_handler_field_view.inc @@ -356,10 +356,15 @@ class views_field_view_handler_field_view extends views_handler_field { function render($values) { $output = NULL; - // If it's not a field handler and there are no values - // Get the first result row from the view and use that. - if ($this->handler_type !== 'field' && !is_object($values)) { - $values = (empty($this->view->result)) ? (object) $values : reset($this->view->result); + + // In case we got an empty result in a header or footer area, we will not + // render the view. + // The empty area allways passes $values == FALSE, so we are fine in the + // case we want to ender a view in the empty region. + // We do not touch $values here, as will never be touched by an area in the + // rest + if ($this->handler_type !== 'field' && $values === TRUE) { + return ''; } static $running = array(); @@ -449,7 +454,9 @@ class views_field_view_handler_field_view extends views_handler_field { $output = t('Recursion, stop!'); } - if (!empty($output)) { + // We only provide the output as field value to the field handler. In other + // cases the $values hasn't even been touched. + if ($this->handler_type == 'field' && !empty($output)) { // Add the rendered output back to the $values object // so it is available in $view->result objects. $values->{'views_field_view_' . $this->options['id']} = $output;