Issue #1677784 by kenneth.venken, dawehner: Follow up, Make sure the empty area is rendered on empty results.
parent
1f904665f8
commit
ef66e0021a
|
@ -26,6 +26,20 @@ use Drupal\views\Plugin\views\Handler;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class AreaPluginBase extends Handler {
|
class AreaPluginBase extends Handler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Overrides Handler::init().
|
||||||
|
*
|
||||||
|
* Make sure that no result area handlers are set to be shown when the result
|
||||||
|
* is empty.
|
||||||
|
*/
|
||||||
|
function init(&$view, &$options) {
|
||||||
|
parent::init($view, $options);
|
||||||
|
if ($this->handler_type == 'empty') {
|
||||||
|
$this->options['empty'] = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get this field's label.
|
* Get this field's label.
|
||||||
*/
|
*/
|
||||||
|
@ -42,7 +56,7 @@ class AreaPluginBase extends Handler {
|
||||||
$this->definition['field'] = !empty($this->definition['field']) ? $this->definition['field'] : '';
|
$this->definition['field'] = !empty($this->definition['field']) ? $this->definition['field'] : '';
|
||||||
$label = !empty($this->definition['label']) ? $this->definition['label'] : $this->definition['field'];
|
$label = !empty($this->definition['label']) ? $this->definition['label'] : $this->definition['field'];
|
||||||
$options['label'] = array('default' => $label, 'translatable' => TRUE);
|
$options['label'] = array('default' => $label, 'translatable' => TRUE);
|
||||||
$options['empty'] = array('default' => 0, 'bool' => TRUE);
|
$options['empty'] = array('default' => FALSE, 'bool' => TRUE);
|
||||||
|
|
||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue