diff --git a/includes/admin.inc b/includes/admin.inc index 71bd265cfce0a18b8381c2e9fb592687e0308b9c..d7e770fdef84f9d181383ffed435a0d68440762b 100644 --- a/includes/admin.inc +++ b/includes/admin.inc @@ -2172,7 +2172,8 @@ function views_ui_edit_form_get_bucket($type, $view, $display) { break; case 'field': // Fetch the style plugin info so we know whether to list fields or not. - $style_plugin = $display->handler->getPlugin(); + $name = $display->handler->getOption('style_plugin'); + $style_plugin = $display->handler->getPlugin('style', $name); $uses_fields = $style_plugin && $style_plugin->usesFields(); if (!$uses_fields) { $build['fields'][] = array( diff --git a/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php index 2908635ae704918a4fec394b92a3e43f85d64458..cd33bfe116e7cfdf4549162368810066217a7ed7 100644 --- a/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php +++ b/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php @@ -763,7 +763,8 @@ public function getOption($option) { * @return bool */ public function usesFields() { - $plugin = $this->getPlugin('style'); + $name = $this->getOption('style_plugin'); + $plugin = $this->getPlugin('style', $name); if ($plugin) { return $plugin->usesFields(); } @@ -1116,8 +1117,9 @@ public function optionsSummary(&$categories, &$options) { ); $manager = new ViewsPluginManager('style'); - $style_plugin = $manager->getDefinition($this->getOption('style_plugin')); - $style_plugin_instance = $this->getPlugin('style'); + $name = $this->getOption('style_plugin'); + $style_plugin = $manager->getDefinition($name); + $style_plugin_instance = $this->getPlugin('style', $name); $style_summary = empty($style_plugin['title']) ? t('Missing style plugin') : $style_plugin_instance->summaryTitle(); $style_title = empty($style_plugin['title']) ? t('Missing style plugin') : $style_plugin_instance->pluginTitle(); @@ -1138,8 +1140,9 @@ public function optionsSummary(&$categories, &$options) { if ($style_plugin_instance->usesRowPlugin()) { $manager = new ViewsPluginManager('row'); - $row_plugin = $manager->getDefinition($this->getOption('row_plugin')); - $row_plugin_instance = $this->getPlugin('row'); + $name = $this->getOption('row_plugin'); + $row_plugin = $manager->getDefinition($name); + $row_plugin_instance = $this->getPlugin('row', $name); $row_summary = empty($row_plugin['title']) ? t('Missing style plugin') : $row_plugin_instance->summaryTitle(); $row_title = empty($row_plugin['title']) ? t('Missing style plugin') : $row_plugin_instance->pluginTitle(); @@ -1645,7 +1648,8 @@ public function buildOptionsForm(&$form, &$form_state) { '#description' => t('If the style you choose has settings, be sure to click the settings button that will appear next to it in the View summary.'), ); - $style_plugin = $this->getPlugin('style'); + $name = $this->getOption('style_plugin'); + $style_plugin = $this->getPlugin('style', $name); if ($style_plugin->usesOptions()) { $form['markup'] = array( '#markup' => '<div class="form-item description">' . t('You may also adjust the !settings for the currently selected style.', array('!settings' => $this->optionLink(t('settings'), 'style_options'))) . '</div>', @@ -1684,7 +1688,8 @@ public function buildOptionsForm(&$form, &$form_state) { '#default_value' => $this->getOption('row_plugin'), ); - $row_plugin = $this->getPlugin('row'); + $name = $this->getOption('row_plugin'); + $row_plugin = $this->getPlugin('row', $name); if ($row_plugin->usesOptions()) { $form['markup'] = array( '#markup' => '<div class="form-item description">' . t('You may also adjust the !settings for the currently selected row style.', array('!settings' => $this->optionLink(t('settings'), 'row_options'))) . '</div>', @@ -1832,7 +1837,8 @@ public function buildOptionsForm(&$form, &$form_state) { } } - $plugin = $this->getPlugin(); + $name = $this->getOption('style_plugin'); + $plugin = $this->getPlugin('style', $name); if ($plugin) { $funcs[] = $this->optionLink(t('Style output'), 'analyze-theme-style') . ': ' . $this->formatThemes($plugin->themeFunctions(), $plugin->additionalThemeFunctions()); $themes = $plugin->additionalThemeFunctions(); @@ -1843,7 +1849,8 @@ public function buildOptionsForm(&$form, &$form_state) { } if ($plugin->usesRowPlugin()) { - $row_plugin = $this->getPlugin('row'); + $name = $this->getOption('row_plugin'); + $row_plugin = $this->getPlugin('row', $name); if ($row_plugin) { $funcs[] = $this->optionLink(t('Row style output'), 'analyze-theme-row') . ': ' . $this->formatThemes($row_plugin->themeFunctions()); $themes = $row_plugin->additionalThemeFunctions(); @@ -1945,7 +1952,8 @@ public function buildOptionsForm(&$form, &$form_state) { $form['#title'] .= t('Theming information (style)'); $output = '<p>' . t('Back to !info.', array('!info' => $this->optionLink(t('theming information'), 'analyze-theme'))) . '</p>'; - $plugin = $this->getPlugin(); + $name = $this->getOption('style_plugin'); + $plugin = $this->getPlugin('style', $name); if (empty($plugin->definition['theme'])) { $output .= t('This display has no style theming information'); @@ -1972,7 +1980,8 @@ public function buildOptionsForm(&$form, &$form_state) { $form['#title'] .= t('Theming information (row style)'); $output = '<p>' . t('Back to !info.', array('!info' => $this->optionLink(t('theming information'), 'analyze-theme'))) . '</p>'; - $plugin = $this->getPlugin('row'); + $name = $this->getOption('row_plugin'); + $plugin = $this->getPlugin('row', $name); if (empty($plugin->definition['theme'])) { $output .= t('This display has no row style theming information'); @@ -2640,7 +2649,8 @@ public function validate() { } // Validate style plugin - $style = $this->getPlugin(); + $name = $this->getOption('style_plugin'); + $style = $this->getPlugin('style', $name); if (empty($style)) { $errors[] = t('Display "@display" has an invalid style plugin.', array('@display' => $this->display->display_title)); } @@ -2832,7 +2842,8 @@ public function exportHandler($indent, $prefix, $storage, $option, $definition, */ public function exportStyle($indent, $prefix, $storage, $option, $definition, $parents) { $output = ''; - $style_plugin = $this->getPlugin(); + $name = $this->getOption('style_plugin'); + $style_plugin = $this->getPlugin('style', $name); if ($option == 'style_plugin') { $type = 'style'; $options_field = 'style_options'; @@ -2845,7 +2856,8 @@ public function exportStyle($indent, $prefix, $storage, $option, $definition, $p $type = 'row'; $options_field = 'row_options'; - $plugin = $this->getPlugin('row'); + $name = $this->getOption('row_plugin'); + $plugin = $this->getPlugin('row', $name); // If the style plugin doesn't use row plugins, don't even bother. } @@ -2893,10 +2905,9 @@ public function exportPlugin($indent, $prefix, $storage, $option, $definition, $ public function unpackStyle($indent, $prefix, $storage, $option, $definition, $parents) { $output = ''; - $style_plugin = $this->getPlugin(); + $name = $this->getOption('style_plugin'); + $style_plugin = $this->getPlugin('style', $name); if ($option == 'style_plugin') { - $type = 'style'; - $options_field = 'style_options'; $plugin = $style_plugin; } else { @@ -2904,9 +2915,8 @@ public function unpackStyle($indent, $prefix, $storage, $option, $definition, $p return; } - $type = 'row'; - $options_field = 'row_options'; - $plugin = $this->getPlugin('row'); + $name = $this->getOption('row_plugin'); + $plugin = $this->getPlugin('row', $name); // If the style plugin doesn't use row plugins, don't even bother. } diff --git a/lib/Drupal/views/Plugin/views/display/Feed.php b/lib/Drupal/views/Plugin/views/display/Feed.php index a73cf914207b29bb77ec1a49ff0381e97ab5bfb5..17568926509fd748a6a63850fd89686002625453 100644 --- a/lib/Drupal/views/Plugin/views/display/Feed.php +++ b/lib/Drupal/views/Plugin/views/display/Feed.php @@ -240,7 +240,8 @@ public function attachTo($display_id) { // Defer to the feed style; it may put in meta information, and/or // attach a feed icon. - $plugin = $this->getPlugin('style'); + $name = $this->getOption('style_plugin'); + $plugin = $this->getPlugin('style', $name); if ($plugin) { $clone = $this->view->cloneView(); $clone->setDisplay($this->display->id); diff --git a/lib/Drupal/views/Plugin/views/style/StylePluginBase.php b/lib/Drupal/views/Plugin/views/style/StylePluginBase.php index 8bb02b82e4d0fcc3783c595be19c3436f2284f7d..89e79cee984742e4cf71323ba4bfc46ed5b263f0 100644 --- a/lib/Drupal/views/Plugin/views/style/StylePluginBase.php +++ b/lib/Drupal/views/Plugin/views/style/StylePluginBase.php @@ -661,7 +661,8 @@ public function validate() { $errors = parent::validate(); if ($this->usesRowPlugin()) { - $plugin = $this->display->handler->getPlugin('row'); + $name = $this->display->handler->getOption('row_plugin'); + $plugin = $this->display->handler->getPlugin('row', $name); if (empty($plugin)) { $errors[] = t('Style @style requires a row style but the row plugin is invalid.', array('@style' => $this->definition['title'])); }