diff --git a/core/modules/views/src/Plugin/views/display/Attachment.php b/core/modules/views/src/Plugin/views/display/Attachment.php index 30870a0..141a1fc 100644 --- a/core/modules/views/src/Plugin/views/display/Attachment.php +++ b/core/modules/views/src/Plugin/views/display/Attachment.php @@ -232,9 +232,9 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state) { } /** - * Attach to another view. + * {@inheritdoc} */ - public function attachTo(ViewExecutable $view, $display_id) { + public function attachTo(ViewExecutable $view, $display_id, array &$build) { $displays = $this->getOption('displays'); if (empty($displays[$display_id])) { diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index 6491f58..5e9965a 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -420,8 +420,15 @@ public function usesAreas() { /** * Allow displays to attach to other views. - */ - public function attachTo(ViewExecutable $view, $display_id) { } + * + * @param \Drupal\views\ViewExecutable $view + * The views executable. + * @param string $display_id + * The display to attach to. + * @param array $build + * The main view render array + */ + public function attachTo(ViewExecutable $view, $display_id, array &$build) { } /** * Static member function to list which sections are defaultable diff --git a/core/modules/views/src/Plugin/views/display/Feed.php b/core/modules/views/src/Plugin/views/display/Feed.php index 3170a29..f544cdf 100644 --- a/core/modules/views/src/Plugin/views/display/Feed.php +++ b/core/modules/views/src/Plugin/views/display/Feed.php @@ -253,9 +253,9 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state) { } /** - * Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::attachTo(). + * {@inheritdoc} */ - public function attachTo(ViewExecutable $clone, $display_id) { + public function attachTo(ViewExecutable $clone, $display_id, array &$build) { $displays = $this->getOption('displays'); if (empty($displays[$display_id])) { return; @@ -266,7 +266,7 @@ public function attachTo(ViewExecutable $clone, $display_id) { $clone->setDisplay($this->display['id']); $clone->buildTitle(); if ($plugin = $clone->display_handler->getPlugin('style')) { - $plugin->attachTo($display_id, $this->getPath(), $clone->getTitle()); + $plugin->attachTo($build, $display_id, $this->getPath(), $clone->getTitle()); } // Clean up. diff --git a/core/modules/views/src/Plugin/views/style/Opml.php b/core/modules/views/src/Plugin/views/style/Opml.php index 7080edb..a1a0094 100644 --- a/core/modules/views/src/Plugin/views/style/Opml.php +++ b/core/modules/views/src/Plugin/views/style/Opml.php @@ -32,7 +32,7 @@ class Opml extends StylePluginBase { /** * {@inheritdoc} */ - public function attachTo($display_id, $path, $title) { + public function attachTo(array &$build, $display_id, $path, $title) { $display = $this->view->displayHandlers->get($display_id); $url_options = array(); $input = $this->view->getExposedInput(); @@ -45,19 +45,15 @@ public function attachTo($display_id, $path, $title) { if ($display->hasPath()) { if (empty($this->preview)) { $build['#attached']['drupal_add_feed'][] = array($url, $title); - drupal_render($build); } } else { - if (empty($this->view->feed_icon)) { - $this->view->feed_icon = ''; - } $feed_icon = array( '#theme' => 'feed_icon', '#url' => $url, '#title' => $title, ); - $this->view->feed_icon .= drupal_render($feed_icon); + $this->view->feed_icon = $feed_icon; } } diff --git a/core/modules/views/src/Plugin/views/style/Rss.php b/core/modules/views/src/Plugin/views/style/Rss.php index c8277f8..8bfe130 100644 --- a/core/modules/views/src/Plugin/views/style/Rss.php +++ b/core/modules/views/src/Plugin/views/style/Rss.php @@ -32,7 +32,7 @@ class Rss extends StylePluginBase { */ protected $usesRowPlugin = TRUE; - public function attachTo($display_id, $path, $title) { + public function attachTo(array &$build, $display_id, $path, $title) { $display = $this->view->displayHandlers->get($display_id); $url_options = array(); $input = $this->view->getExposedInput(); @@ -57,7 +57,7 @@ public function attachTo($display_id, $path, $title) { $this->view->feed_icon = $feed_icon; // Add a call for drupal_add_html_head_link to the view attached data. - $this->view->element['#attached']['drupal_add_html_head_link'][][] = array( + $build['#attached']['drupal_add_html_head_link'][][] = array( 'rel' => 'alternate', 'type' => 'application/rss+xml', 'title' => $title,