Issue #2002486 by crowdcg, shixish: Rename Views method even_empty() to evenEmpty().
parent
7731380b6b
commit
c4e1535220
|
@ -99,7 +99,7 @@ class EntityReference extends DisplayPluginBase {
|
||||||
* Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::render().
|
* Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::render().
|
||||||
*/
|
*/
|
||||||
public function 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 $this->view->style_plugin->render($this->view->result);
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
|
|
|
@ -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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
* 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']);
|
return !empty($this->definition['even empty']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -387,8 +387,8 @@ class Table extends StylePluginBase {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function even_empty() {
|
public function evenEmpty() {
|
||||||
return parent::even_empty() || !empty($this->options['empty_table']);
|
return parent::evenEmpty() || !empty($this->options['empty_table']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function wizardSubmit(&$form, &$form_state, WizardInterface $wizard, &$display_options, $display_type) {
|
public function wizardSubmit(&$form, &$form_state, WizardInterface $wizard, &$display_options, $display_type) {
|
||||||
|
|
|
@ -54,7 +54,7 @@ function template_preprocess_views_view(&$vars) {
|
||||||
|
|
||||||
$view = $vars['view'];
|
$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.
|
// Force a render array so CSS/JS can be added.
|
||||||
if (!is_array($vars['rows'])) {
|
if (!is_array($vars['rows'])) {
|
||||||
$vars['rows'] = array('#markup' => $vars['rows']);
|
$vars['rows'] = array('#markup' => $vars['rows']);
|
||||||
|
|
Loading…
Reference in New Issue