diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php index eb22ed2..4cb4945 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php @@ -2724,6 +2724,18 @@ public function getPagerText() { ); } + /** + * Merges default values for all plugin types. + */ + public function mergeDefaults() { + foreach (array('access', 'cache', 'query', 'exposed_form', 'pager', 'style', 'row') as $type) { + if (isset($this->display['display_options'][$type]['type'])) { + $plugin = $this->getPlugin($type); + $this->display['display_options'][$type]['options'] += $plugin->options; + } + } + } + } /** diff --git a/core/modules/views/lib/Drupal/views/ViewStorageController.php b/core/modules/views/lib/Drupal/views/ViewStorageController.php index ebc2317..739a624 100644 --- a/core/modules/views/lib/Drupal/views/ViewStorageController.php +++ b/core/modules/views/lib/Drupal/views/ViewStorageController.php @@ -47,14 +47,9 @@ protected function attachLoad(&$queried_entities, $revision_id = FALSE) { protected function preSave(EntityInterface $entity) { $executable = $entity->get('executable'); $executable->initDisplay(); + foreach ($executable->displayHandlers as $display) { - foreach (array('access', 'cache', 'query', 'exposed_form', 'pager', 'style', 'row') as $type) { - if (isset($display->display['display_options'][$type]['type'])) { - $plugin = Views::pluginManager($type)->createInstance($display->options[$type]['type']); - $plugin->init($executable, $display); - $display->display['display_options'][$type]['options'] += $plugin->options; - } - } + $display->mergeDefaults(); } }