Created
September 1, 2014 11:18
-
-
Save damiankloip/c4372c7dc312081c985a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/modules/views/src/Plugin/views/style/Rss.php b/core/modules/views/src/Plugin/views/style/Rss.php | |
index 788e13a..c8277f8 100644 | |
--- a/core/modules/views/src/Plugin/views/style/Rss.php | |
+++ b/core/modules/views/src/Plugin/views/style/Rss.php | |
@@ -44,7 +44,8 @@ public function attachTo($display_id, $path, $title) { | |
$url = url($this->view->getUrl(NULL, $path), $url_options); | |
if ($display->hasPath()) { | |
if (empty($this->preview)) { | |
- drupal_add_feed($url, $title); | |
+ // Add a call for drupal_add_feed to the view attached data. | |
+ $this->view->element['#attached']['drupal_add_feed'][] = array($url, $title); | |
} | |
} | |
else { | |
@@ -53,14 +54,15 @@ public function attachTo($display_id, $path, $title) { | |
'#url' => $url, | |
'#title' => $title, | |
); | |
- $feed_icon['#attached']['drupal_add_html_head_link'][][] = array( | |
+ $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( | |
'rel' => 'alternate', | |
'type' => 'application/rss+xml', | |
'title' => $title, | |
'href' => $url, | |
); | |
- $this->view->feed_icon = $feed_icon; | |
- drupal_process_attached($feed_icon); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment