diff --git a/core/modules/views/lib/Drupal/views/DisplayArray.php b/core/modules/views/lib/Drupal/views/DisplayArray.php index b9c5e70..f368408 100644 --- a/core/modules/views/lib/Drupal/views/DisplayArray.php +++ b/core/modules/views/lib/Drupal/views/DisplayArray.php @@ -66,7 +66,7 @@ public function __destruct() { * The name of the display to initialize. */ protected function initializeDisplay($display_id) { - // If the display was initialize before just return. + // If the display was initialized before, just return. if (isset($this->displayHandlers[$display_id])) { return; } @@ -74,6 +74,12 @@ protected function initializeDisplay($display_id) { // Retrieve and initialize the new display handler with data. $display = &$this->view->storage->getDisplay($display_id); $this->displayHandlers[$display_id] = views_get_plugin('display', $display['display_plugin']); + if (empty($this->displayHandlers[$display_id])) { + // Provide a 'default' handler as an emergency. This won't work well but + // it will keep things from crashing. + $this->displayHandlers[$display_id] = views_get_plugin('display', 'default'); + } + $this->displayHandlers[$display_id]->init($this->view, $display); // If this is not the default display handler, let it know which is since // it may well utilize some data from the default. diff --git a/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.php b/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.php index 58dc5cd..7438ce1 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Core/Entity/View.php @@ -302,8 +302,8 @@ protected function generateDisplayId($plugin_id) { * (optional) The ID to use, e.g., 'default', 'page_1', 'block_2'. Defaults * to NULL. * - * @return Drupal\views\Plugin\views\display\DisplayPluginBase - * A reference to the new handler object. + * @return \Drupal\views\Plugin\views\display\DisplayPluginBase + * A new display plugin instance. */ public function newDisplay($plugin_id = 'page', $title = NULL, $id = NULL) { $id = $this->addDisplay($plugin_id, $title, $id);