Commit 228a2aa3 authored by alexpott's avatar alexpott

Issue #1931860 by dawehner, damiankloip: Remove plugin_name() property from ViewExecutable.

parent ff1eea33
......@@ -774,8 +774,8 @@ function default_summary() {
// Change the display style to the summary style for this
// argument.
$this->view->plugin_name = $this->options['summary']['format'];
$this->view->style_options = $this->options['summary_options'];
$this->view->style_plugin = Views::pluginManager("style")->createInstance($this->options['summary']['format']);
$this->view->style_plugin->init($this->view, $this->displayHandler, $this->options['summary_options']);
// Clear out the normal primary field and whatever else may have
// been added and let the summary do the work.
......
......@@ -213,14 +213,12 @@ public function testDisplays() {
$view->initStyle();
$this->assertTrue($view->style_plugin instanceof DefaultStyle);
$this->assertTrue($view->rowPlugin instanceof Fields);
$this->assertEqual($view->plugin_name, 'default');
$view->setDisplay('page_2');
$view->initStyle();
$this->assertTrue($view->style_plugin instanceof Grid);
// @todo Change this rowPlugin type too.
$this->assertTrue($view->rowPlugin instanceof Fields);
$this->assertEqual($view->plugin_name, 'grid');
}
/**
......
......@@ -208,7 +208,7 @@ class ViewExecutable {
/**
* The current used style plugin.
*
* @var Drupal\views\Plugin\views\style\StylePluginBase
* @var \Drupal\views\Plugin\views\style\StylePluginBase
*/
public $style_plugin;
......@@ -341,24 +341,6 @@ class ViewExecutable {
*/
public $inited;
/**
* The name of the active style plugin of the view.
*
* @todo remove this and just use $this->style_plugin
*
* @var string
*/
public $plugin_name;
/**
* The options used by the style plugin of this running view.
*
* @todo To be able to remove it, Drupal\views\Plugin\views\argument\ArgumentPluginBase::default_summary()
* should instantiate the style plugin.
* @var array
*/
public $style_options;
/**
* The rendered output of the exposed form.
*
......@@ -709,23 +691,15 @@ public function setDisplay($display_id = NULL) {
*/
public function initStyle() {
if (isset($this->style_plugin)) {
return is_object($this->style_plugin);
}
if (!isset($this->plugin_name)) {
$style = $this->display_handler->getOption('style');
$this->plugin_name = $style['type'];
$this->style_options = $style['options'];
return TRUE;
}
$this->style_plugin = Views::pluginManager("style")->createInstance($this->plugin_name);
$this->style_plugin = $this->display_handler->getPlugin('style');
if (empty($this->style_plugin)) {
return FALSE;
}
// init the new style handler with data.
$this->style_plugin->init($this, $this->display_handler, $this->style_options);
return TRUE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment