diff --git a/core/modules/views/src/Plugin/views/style/StylePluginBase.php b/core/modules/views/src/Plugin/views/style/StylePluginBase.php index 3bee96a..d2c378c 100644 --- a/core/modules/views/src/Plugin/views/style/StylePluginBase.php +++ b/core/modules/views/src/Plugin/views/style/StylePluginBase.php @@ -119,7 +119,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o parent::init($view, $display, $options); if ($this->usesRowPlugin() && $display->getOption('row')) { - $this->view->rowPlugin = $display->getPlugin('row'); + $this->view->rowPlugin = $view->getRowPlugin(); } $this->options += array( diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php index a29d452..ba356dd 100644 --- a/core/modules/views/src/ViewExecutable.php +++ b/core/modules/views/src/ViewExecutable.php @@ -214,6 +214,9 @@ class ViewExecutable implements \Serializable { * The current used style plugin. * * @var \Drupal\views\Plugin\views\style\StylePluginBase + * + * @deprecated as of Drupal 8.0.x and access will be removed in Drupal 8.2.x. + * Use getStylePlugin() instead to get this property. */ public $style_plugin; @@ -221,6 +224,9 @@ class ViewExecutable implements \Serializable { * The current used row plugin, if the style plugin supports row plugins. * * @var \Drupal\views\Plugin\views\row\RowPluginBase + * + * @deprecated as of Drupal 8.0.x and access will be removed in Drupal 8.2.x. + * Use getRowPlugin() instead to get this property. */ public $rowPlugin; @@ -846,8 +852,20 @@ public function newDisplay($plugin_id = 'page', $title = NULL, $id = NULL) { * * @return \Drupal\views\Plugin\views\style\StylePluginBase * The current style plugin. + * + * @deprecated as of Drupal 8.0.x and access will be removed in Drupal 8.2.x. */ public function getStyle() { + return $this->getStylePlugin(); + } + + /** + * Gets the current style plugin. + * + * @return \Drupal\views\Plugin\views\style\StylePluginBase + * The current style plugin. + */ + public function getStylePlugin() { if (!isset($this->style_plugin)) { $this->initStyle(); } @@ -856,6 +874,20 @@ public function getStyle() { } /** + * Gets the current row plugin. + * + * @return \Drupal\views\Plugin\views\row\RowPluginBase + * The current row plugin. + */ + public function getRowPlugin() { + if (!isset($this->rowPlugin)) { + $this->rowPlugin = $this->display_handler->getPlugin('row'); + } + + return $this->rowPlugin; + } + + /** * Finds and initializes the style plugin. * * Note that arguments may have changed which style plugin we use, so