Issue #2002486 by crowdcg, shixish: Rename Views method even_empty() to evenEmpty().

8.0.x
Alex Pott 2013-06-05 08:40:33 +01:00
parent 7731380b6b
commit c4e1535220
5 changed files with 7 additions and 7 deletions

View File

@ -99,7 +99,7 @@ class EntityReference extends DisplayPluginBase {
* Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::render().
*/
public function render() {
if (!empty($this->view->result) && $this->view->style_plugin->even_empty()) {
if (!empty($this->view->result) && $this->view->style_plugin->evenEmpty()) {
return $this->view->style_plugin->render($this->view->result);
}
return '';

View File

@ -102,9 +102,9 @@ class EntityReference extends StylePluginBase {
}
/**
* Overrides \Drupal\views\Plugin\views\style\StylePluginBase\StylePluginBase::even_empty().
* {@inheritdoc}
*/
function even_empty() {
public function evenEmpty() {
return TRUE;
}
}

View File

@ -224,7 +224,7 @@ abstract class StylePluginBase extends PluginBase {
/**
* Should the output of the style plugin be rendered even if it's a empty view.
*/
function even_empty() {
public function evenEmpty() {
return !empty($this->definition['even empty']);
}

View File

@ -387,8 +387,8 @@ class Table extends StylePluginBase {
);
}
function even_empty() {
return parent::even_empty() || !empty($this->options['empty_table']);
public function evenEmpty() {
return parent::evenEmpty() || !empty($this->options['empty_table']);
}
public function wizardSubmit(&$form, &$form_state, WizardInterface $wizard, &$display_options, $display_type) {

View File

@ -54,7 +54,7 @@ function template_preprocess_views_view(&$vars) {
$view = $vars['view'];
$vars['rows'] = (!empty($view->result) || $view->style_plugin->even_empty()) ? $view->style_plugin->render($view->result) : array();
$vars['rows'] = (!empty($view->result) || $view->style_plugin->evenEmpty()) ? $view->style_plugin->render($view->result) : array();
// Force a render array so CSS/JS can be added.
if (!is_array($vars['rows'])) {
$vars['rows'] = array('#markup' => $vars['rows']);