diff --git a/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php b/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php index 0a99bfc63e65e3e18733b92c574ee986dbb27688..3d31a9dca1c409b2dafb59eb6ecc80e638a241af 100644 --- a/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php +++ b/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php @@ -26,6 +26,20 @@ /** */ 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. */ @@ -42,7 +56,7 @@ function option_definition() { $this->definition['field'] = !empty($this->definition['field']) ? $this->definition['field'] : ''; $label = !empty($this->definition['label']) ? $this->definition['label'] : $this->definition['field']; $options['label'] = array('default' => $label, 'translatable' => TRUE); - $options['empty'] = array('default' => 0, 'bool' => TRUE); + $options['empty'] = array('default' => FALSE, 'bool' => TRUE); return $options; }