Bug 16111: Further fixes to the RSS to make feed work
authorLiz Rea <wizzyrea@gmail.com>
Mon, 19 Aug 2019 01:51:04 +0000 (01:51 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 6 Sep 2019 12:21:08 +0000 (13:21 +0100)
- fixed links per the WC3 spec
- fixed a problem in the ATOM link

To test:
do a search, click the RSS icon - it shows xml in most browsers but wont
do RSS type things.
Apply this patch, restart the things
refresh the page, it should do RSS things (i.e. firefox should render it
        as a nice looking thing, rather than raw XML.)

noting that there are a couple of validation errors still, but they
don't seem to be show stopping and moreover I wasn't sure how to fix them:

Misplaced Item
Self reference doesn't match document location (this is a "for widest
        compatibility you should fix" kind of thing)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt

index 5496dec..bc26e9d 100644 (file)
@@ -24,7 +24,7 @@
    <channel>
      <title><![CDATA[[% LibraryName | html %] Search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %]]]></title>
      <link>[% OPACBaseURL | html %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;format=rss</link>
-     <atom:link rel="self" type="application/rss+xml" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;sort_by=[% sort_by | uri %]&amp;format=atom"/>
+     <atom:link rel="self" type="application/rss+xml" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% SEARCH_RESULT.query_cgi | $raw %][% SEARCH_RESULT.limit_cgi | $raw %]&amp;sort_by=[% sort_by | uri %]&amp;format=atom"/>
      <description><![CDATA[ Search results [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %] at [% LibraryName | html %]]]></description>
      <opensearch:totalResults>[% total | html %]</opensearch:totalResults>
      <opensearch:startIndex>[% offset | html %]</opensearch:startIndex>
        <title>[% INCLUDE 'biblio-title-head.inc' biblio=SEARCH_RESULT %]</title>
        <dc:identifier>ISBN [% SEARCH_RESULT.isbn | html %]</dc:identifier>
         [% IF ( SEARCH_RESULT.BiblioDefaultViewmarc ) %]
-            <link href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]" />
+        <link>[% OPACBaseURL | url %]/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]</link>
         [% ELSIF ( SEARCH_RESULT.BiblioDefaultViewisbd ) %]
-            <link href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]" />
+        <link>[% OPACBaseURL | url %]/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]</link>
         [% ELSE %]
-            <link href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]" />
+        <link>[% OPACBaseURL | url %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]</link>
         [% END %]
        <description><![CDATA[
 [% IF ( AdlibrisEnabled && SEARCH_RESULT.normalized_isbn ) %]