Views RSS feeds have validation issues

Created on 10 November 2011, about 13 years ago
Updated 20 January 2023, almost 2 years 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 review

Version

10.1

Component
Views 

Last updated 14 minutes ago

Created by

🇫🇷France jvieille

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

Merge Requests

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 almost 2 years 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...

  • 🇳🇱Netherlands Lendude Amsterdam

    The IS is still talking about D7 and contrib View, where it looks like this has actually been addressed, so could somebody update the IS to make it more current? I'm assuming this is still an issue

  • 🇺🇸United States nicxvan

    Aside from the issue summary update, there is a fix here for the cdata that is out in 11.0 and 10.4 🐛 Use CDATA in XML RSS Feeds Fixed .

    The core rss feed should be generated on that version and run through a validator to identify any remaining issues.

  • 🇳🇿New Zealand ericgsmith

    Have tested on 11.x and it still producing the same recommendation. Updated the issue summary steps to remove reference to drupal 7 and use terminology in the current views UI - also tweaked to title to clarify this is a recommendation not an error.

  • 🇳🇿New Zealand ericgsmith

    Moved the existing patch to an MR.

    Tested again and Len's comment is #42 is correct - this patch causes an error when following the steps to reproduce. Once you add the new view and before saving it the preview will through an exception as we are trying to get a route for a view that does not exist.

    Once the view is saved the validation recommendation is resolved - leaving as "Needs work" as the approach to resolve the issue does not have consensus.

  • Pipeline finished with Success
    14 days ago
    Total: 467s
    #374198
Production build 0.71.5 2024