Commit 0b668903 authored by alexpott's avatar alexpott

Issue #2191101 by Cottser, thedavidmeister | xjm: Replace calls to theme()...

Issue #2191101 by Cottser, thedavidmeister | xjm: Replace calls to theme() with drupal_render() in Views plugins.
parent ddfbbf54
......@@ -1591,8 +1591,7 @@ protected function addSelfTokens(&$tokens, $item) { }
protected function documentSelfTokens(&$tokens) { }
/**
* Call out to the theme() function, which probably just calls render() but
* allows sites to override output fairly easily.
* Pass values to drupal_render() using $this->themeFunctions() as #theme.
*
* @param \Drupal\views\ResultRow $values
* Holds single row of a view's result set.
......@@ -1601,12 +1600,13 @@ protected function documentSelfTokens(&$tokens) { }
* Returns rendered output of the given theme implementation.
*/
function theme(ResultRow $values) {
return theme($this->themeFunctions(),
array(
'view' => $this->view,
'field' => $this,
'row' => $values
));
$build = array(
'#theme' => $this->themeFunctions(),
'#view' => $this->view,
'#field' => $this,
'#row' => $values,
);
return drupal_render($build);
}
public function themeFunctions() {
......
......@@ -171,13 +171,14 @@ public function render($row) {
}
}
return theme($this->themeFunctions(),
array(
'view' => $this->view,
'options' => $this->options,
'row' => $item,
'field_alias' => isset($this->field_alias) ? $this->field_alias : '',
));
$build = array(
'#theme' => $this->themeFunctions(),
'#view' => $this->view,
'#options' => $this->options,
'#row' => $item,
'#field_alias' => isset($this->field_alias) ? $this->field_alias : '',
);
return drupal_render($build);
}
/**
......
......@@ -134,14 +134,14 @@ public function render() {
$rows .= $this->view->rowPlugin->render($row);
}
$output = theme($this->themeFunctions(),
array(
'view' => $this->view,
'options' => $this->options,
'rows' => $rows
));
$build = array(
'#theme' => $this->themeFunctions(),
'#view' => $this->view,
'#options' => $this->options,
'#rows' => $rows,
);
unset($this->view->row_index);
return $output;
return drupal_render($build);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment