Issue #2191101 by Cottser, thedavidmeister | xjm: Replace calls to theme() with drupal_render() in Views plugins.
parent
ddfbbf54ce
commit
0b66890345
|
@ -1591,8 +1591,7 @@ abstract class FieldPluginBase extends HandlerBase {
|
|||
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 @@ abstract class FieldPluginBase extends HandlerBase {
|
|||
* 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 @@ class RssFields extends RowPluginBase {
|
|||
}
|
||||
}
|
||||
|
||||
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 @@ class Rss extends StylePluginBase {
|
|||
$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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue