Views RSS feeds have validation issues

Created on 10 November 2011, almost 13 years ago
Updated 1 March 2023, over 1 year ago

Problem/Motivation

Summary

When creating an RSS feed display and submitting it for validation to the w3c validator, the latter complains about a recommendation that should be implemented (an atom:link tag should be inserted).

Steps to reproduce

  1. Enable views & views_ui (7.x-3.x-dev)
  2. Go to admin/structure/views/add, create a view with a feed display of type RSS, assign it a title and a path and make it accessible to anonymous users (see this screenshot )
  3. Save the view
  4. Go to http://validator.w3.org/feed/
  5. Under 'Validate by URI' tab, enter the URL of the feed

Expected result

  • The RSS feed validates without complaining

Actual result

Proposed resolution

Patch suggested in #5 (this can be tested on https://simplytest.me/ for instance).
When validating the view with the patch, the W3C validator does not complain (see this screenshot ).

Related Issues

Original report by jvieille

I am trying to subscribe a LinkedIngroup to the rss feeds from a Drupal web site.
This feed is generated by my frontpage view.

No items are collected from linkedIn, and I am suspecting some strict validation control by LinkedIn
Feed validator says that the RSS feed is valid, but reports errors
http://validator.w3.org/feed/
the feed address is http://web2.see.asso.fr/rss.xml

- "description should not contain relative URL references"
- "Use of unknown namespace: http://drupal.org/group/og"
- "style attribute contains potentially dangerous content: white-space: pre;"
- "Invalid HTML: EOF in middle of construct"
- Missing atom:link with rel="self"

Thanks for help

🐛 Bug report
Status

Needs work

Version

10.1

Component
Views 

Last updated about 7 hours ago

Created by

🇫🇷France jvieille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Needs work over 1 year ago
  • 🇳🇱Netherlands Lendude Amsterdam
    +++ b/core/modules/views/src/Plugin/views/style/Rss.php
    @@ -88,7 +88,19 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    +    $url = $this->view->getUrl()->setAbsolute()->toString();
    

    Are we sure this is always going to return the correct path? Is the display always set to the RSS display when we reach this point or can we get a page display or a fatal error here?

    Also, I agree with #36, is this the best way to fix this? This could lead to the same element being there multiple times. It might be the best way, but having some validation for this route over changing the template would be good.

  • 🇷🇺Russia kazah

    Still errors of unknown namespaces...

Production build 0.71.5 2024