Problem/Motivation

template_preprocess_views_view_rss() sets the <channel><link> value to the URL of a specific page. However, according to the RSS spec this should be the URL of the website itself (eg. the front page):

link: The URL to the HTML website corresponding to the channel.

https://validator.w3.org/feed/docs/rss2.html#requiredChannelElements

Proposed resolution

Update the RSS <channel><link> value to refer to the frontpage.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

idebr created an issue. See original summary.

idebr’s picture

Attached patch updates the RSS <channel><link> value to refer to the frontpage.

The last submitted patch, 2: 3070620-2-test-only.patch, failed testing. View results

Lendude’s picture

Status: Needs review » Reviewed & tested by the community

I have to say I find the docs less then clear, but this does seem to be right and it is how it is used in the wild (see https://xkcd.com/atom.xml).

Nice test coverage and great to see that large block of (completely untested) logic removed.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 82c4122 and pushed to 8.8.x. Thanks!

  • catch committed 82c4122 on 8.8.x
    Issue #3070620 by idebr, Lendude: RSS <channel><link> element must refer...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

gantal’s picture

I'm not sure if this is the right issue to post this under but I'm a little confused as to why the <channel><link> value is set explicitly to the front page for every RSS feed. If I were to create multiple RSS feed displays, wouldn't each display need its own <link> value as per RSS specifications? A similar issue exists for Views in Drupal 7 (#1932516: Feed Channel Link Wrong with More then one Feed Display) but I could not find a corresponding issue for Drupal 8.