Skip to content
Snippets Groups Projects
Commit 75debc11 authored by catch's avatar catch
Browse files

Issue #2115063 by marcingy: Remove drupal_add_feed().

parent dfd537fe
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -294,10 +294,10 @@ public function categories() {
* The rendered list of items for the feed.
*/
public function pageLast() {
drupal_add_feed('aggregator/rss', $this->config('system.site')->get('name') . ' ' . $this->t('aggregator'));
$items = $this->entityManager()->getStorageController('aggregator_item')->loadAll();
return $this->buildPageList($items);
$build = $this->buildPageList($items);
$build['#attached']['drupal_add_feed'][] = array('aggregator/rss', $this->config('system.site')->get('name') . ' ' . $this->t('aggregator'));
return $build;
}
/**
......
......@@ -117,10 +117,6 @@ public function forumPage(TermInterface $taxonomy_term) {
// Get forum details.
$taxonomy_term->forums = $this->forumManager->getChildren($this->config->get('vocabulary'), $taxonomy_term->id());
$taxonomy_term->parents = $this->forumManager->getParents($taxonomy_term->id());
if (empty($taxonomy_term->forum_container->value)) {
// Add RSS feed for forums.
drupal_add_feed('taxonomy/term/' . $taxonomy_term->id() . '/feed', 'RSS - ' . $taxonomy_term->label());
}
if (empty($taxonomy_term->forum_container->value)) {
$topics = $this->forumManager->getTopics($taxonomy_term->id());
......@@ -178,6 +174,9 @@ protected function build($forums, TermInterface $term, $topics = array(), $paren
'#forums_per_page' => $this->config->get('topics.page_limit'),
);
$build['#attached']['library'][] = array('forum', 'forum.index');
if (empty($term->forum_container->value)) {
$build['#attached']['drupal_add_feed'][] = array('taxonomy/term/' . $term->id() . '/feed', 'RSS - ' . $term->label());
}
return $build;
}
......
......@@ -71,9 +71,11 @@ function testBasicFeedAddNoTitle() {
);
foreach ($urls as $description => $feed_info) {
drupal_add_feed($feed_info['input_url'], $feed_info['title']);
$build['#attached']['drupal_add_feed'][] = array($feed_info['input_url'], $feed_info['title']);
}
drupal_render($build);
$this->drupalSetContent(drupal_get_html_head());
foreach ($urls as $description => $feed_info) {
$this->assertPattern($this->urlToRSSLinkPattern($feed_info['output_url'], $feed_info['title']), format_string('Found correct feed header for %description', array('%description' => $description)));
......
......@@ -19,7 +19,7 @@ function taxonomy_term_page(Term $term) {
// Assign the term name as the page title.
drupal_set_title($term->label());
drupal_add_feed('taxonomy/term/' . $term->id() . '/feed', 'RSS - ' . $term->label());
$build['#attached']['drupal_add_feed'][] = array('taxonomy/term/' . $term->id() . '/feed', 'RSS - ' . $term->label());
foreach ($term->uriRelationships() as $rel) {
$uri = $term->uri($rel);
......
......@@ -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);
$build['#attached']['drupal_add_feed'][] = array($url, $title);
drupal_render($build);
}
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment