Bug 16567 - RSS feeds show issues in W3C validator and can't be read by some aggregators (Chimpfeedr, feedbucket)
Summary: RSS feeds show issues in W3C validator and can't be read by some aggregators ...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal with 10 votes (vote)
Assignee: Owen Leonard
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-23 13:40 UTC by Nick Clemens (kidclamp)
Modified: 2024-04-26 12:16 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00


Attachments
Bug 16567: Correct RSS feed validity errors (29.77 KB, patch)
2024-04-15 15:15 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16567: Correct RSS feed validity errors (29.82 KB, patch)
2024-04-19 13:38 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 16567: Correct RSS feed validity errors (29.89 KB, patch)
2024-04-25 11:19 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2016-05-23 13:40:55 UTC
We are seeing issues with some RSS aggregators refusing to load koha rss links, there are errors when checked in the W3C validator:

https://validator.w3.org/feed/check.cgi
Comment 1 Owen Leonard 2016-05-25 15:51:01 UTC
This may be fixed by Bug 16111.
Comment 2 Katrin Fischer 2024-03-13 14:25:49 UTC
I just checked again in a 22.11 installation and we are still not providing valid RSS data from the search results.

This feed does not validate.

    line 45, column 4: Undefined description element: p (100 occurrences) [help]

        	   <p>
            ^

In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

    line 22, column 163: Self reference doesn't match document location [help]

        ... p;sort_by=acqdate_dsc&amp;format=atom"/>
                                                     ^

    line 32, column 1: Misplaced Item (49 occurrences) [help]

         <item>
Comment 3 Owen Leonard 2024-04-15 15:15:29 UTC
Created attachment 164891 [details] [review]
Bug 16567: Correct RSS feed validity errors

This patch corrects a few markup errors in the XML feeds to make the
feeds validate correctly. The template has been largely re-indented to
improve readability and eliminate tab characters.

To test, apply the patch and perform a search in the OPAC.

- Open the RSS link appearing after the "Your search returned..."
  header.
- Depending on how your browser handles XML documents you may need to
  view source on the page to see the actual XML markup.
- Copy the source and paste it into the W3C feed validator:
  https://validator.w3.org/feed/#validate_by_input
- The feed should be found to be valid.
  - In my tests you'll get a "Recommendation" about "Self reference
    doesn't match document location." I think this recommendation
    doesn't apply.

Perform the same test with the other two available formats: Atom and
OpenSearch:

- Change the end of the RSS feed url from '&format=rss' to
  '&format=atom' and validate the result.
   - The same "self reference" recommendation will come up, and again I
     think we can ignore it.
   - There is another recommendation about "Two entries with the same
     value for atom:updated." The updated time is set to the same time
     as the feed itself (the time when the feed was generated. Maybe
     this is incorrect. If so we need a follow-up that exposes a
     different value to the template. biblio.datecreated maybe?
- Change the end of the feed url from '&format=atom' to
  '&format=OpenSearchDescription' and validate that result.
Comment 4 Brendan Lawlor 2024-04-16 13:57:16 UTC
When I tested this patch rss and atom feeds validated with the same recommendations that you mentioned.

When I tried to change the feed url to &format=OpenSearchDescription it just loaded the OPAC search results page instead of loading an xml document. Maybe I am missing a step to enable that format, or have the parameter wrong somehow?
Comment 5 Owen Leonard 2024-04-19 11:33:50 UTC
(In reply to Brendan Lawlor from comment #4)
> When I tried to change the feed url to &format=OpenSearchDescription it just
> loaded the OPAC search results page

Sorry I copied and pasted the parameter incorrectly. It's case-sensitive, and should be 'opensearchdescription'
Comment 6 Brendan Lawlor 2024-04-19 13:36:58 UTC
Test notes:

When I change the feed url to &format=opensearchdescription the browser behaves slightly different than the other types of feeds.

It immediately downloads a file called opac-search.osdx and redirects back to whatever you were previously on.

I was able to open the opac-search.osdx file with notepad and see that it was xml and validate it with the W3C tool.
Comment 7 Brendan Lawlor 2024-04-19 13:38:17 UTC
Created attachment 165198 [details] [review]
Bug 16567: Correct RSS feed validity errors

This patch corrects a few markup errors in the XML feeds to make the
feeds validate correctly. The template has been largely re-indented to
improve readability and eliminate tab characters.

To test, apply the patch and perform a search in the OPAC.

- Open the RSS link appearing after the "Your search returned..."
  header.
- Depending on how your browser handles XML documents you may need to
  view source on the page to see the actual XML markup.
- Copy the source and paste it into the W3C feed validator:
  https://validator.w3.org/feed/#validate_by_input
- The feed should be found to be valid.
  - In my tests you'll get a "Recommendation" about "Self reference
    doesn't match document location." I think this recommendation
    doesn't apply.

Perform the same test with the other two available formats: Atom and
OpenSearch:

- Change the end of the RSS feed url from '&format=rss' to
  '&format=atom' and validate the result.
   - The same "self reference" recommendation will come up, and again I
     think we can ignore it.
   - There is another recommendation about "Two entries with the same
     value for atom:updated." The updated time is set to the same time
     as the feed itself (the time when the feed was generated. Maybe
     this is incorrect. If so we need a follow-up that exposes a
     different value to the template. biblio.datecreated maybe?
- Change the end of the feed url from '&format=atom' to
  '&format=OpenSearchDescription' and validate that result.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 8 Phil Ringnalda 2024-04-20 00:02:28 UTC
You should be able to check the <link rel="self"> on a sandbox by validating the feed link rather than copy-pasting the feed - when the W3C forked feedvalidator.org and added validate_by_input, they really should have replaced the recommendation with a "Warning: unable to check self reference while validating by input" since they have no idea what the feed URL is.
Comment 9 Martin Renvoize 2024-04-25 11:19:11 UTC
Created attachment 165523 [details] [review]
Bug 16567: Correct RSS feed validity errors

This patch corrects a few markup errors in the XML feeds to make the
feeds validate correctly. The template has been largely re-indented to
improve readability and eliminate tab characters.

To test, apply the patch and perform a search in the OPAC.

- Open the RSS link appearing after the "Your search returned..."
  header.
- Depending on how your browser handles XML documents you may need to
  view source on the page to see the actual XML markup.
- Copy the source and paste it into the W3C feed validator:
  https://validator.w3.org/feed/#validate_by_input
- The feed should be found to be valid.
  - In my tests you'll get a "Recommendation" about "Self reference
    doesn't match document location." I think this recommendation
    doesn't apply.

Perform the same test with the other two available formats: Atom and
OpenSearch:

- Change the end of the RSS feed url from '&format=rss' to
  '&format=atom' and validate the result.
   - The same "self reference" recommendation will come up, and again I
     think we can ignore it.
   - There is another recommendation about "Two entries with the same
     value for atom:updated." The updated time is set to the same time
     as the feed itself (the time when the feed was generated. Maybe
     this is incorrect. If so we need a follow-up that exposes a
     different value to the template. biblio.datecreated maybe?
- Change the end of the feed url from '&format=atom' to
  '&format=OpenSearchDescription' and validate that result.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Katrin Fischer 2024-04-26 11:17:10 UTC
Pretty happy to see this addressed :)
Comment 11 Katrin Fischer 2024-04-26 12:16:46 UTC
Pushed for 24.05!

Well done everyone, thank you!