[Patches] [PATCH] [Signed Off] Bug 6147 : Correcting invalid RSS

koha-patchbot at kohaaloha.com koha-patchbot at kohaaloha.com
Sun Jan 1 12:10:03 NZDT 2012


From: Christophe Croullebois <christophe.croullebois at biblibre.com>
Date: Tue, 17 May 2011 10:16:07 +1200
Subject: [PATCH] [Signed Off] Bug 6147 : Correcting invalid RSS
Content-Type: text/plain; charset="utf-8"

Signed-off-by: Liz Rea <wizzyrea at gmail.com>
Feed validates using http://feed1.w3.org/ with the following recommendations:

This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
line 12, column 149: Relative href value on self link: /cgi-bin/koha/opac-search.pl?idx=kw&q=some&sort_by=acqdate_dsc&format=rss2 [help]
... p;sort_by=acqdate_dsc&format=rss2"/>
                                             ^
line 12, column 149: Self reference doesn't match document location [help]
... p;sort_by=acqdate_dsc&format=rss2"/>
                                             ^
line 20, column 158: Unregistered link relationship: search (10 occurrences) [help]
... _by=&format=opensearchdescription"/>
                                             ^
line 40, column 9: description should not contain relative URL references: /cgi-bin/koha/opac-reserve.pl?biblionumber=10 (10 occurrences) [help]
						]]></description>
         ^
line 22, column 5: Misplaced Item (9 occurrences) [help]
     <item>
---
 .../opac-tmpl/prog/en/modules/opac-opensearch.tt   |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-opensearch.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-opensearch.tt
index 0710344..14a5f3e 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-opensearch.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-opensearch.tt
@@ -14,11 +14,12 @@
 [% IF ( rss2 ) %]
 <rss version="2.0"
       xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
+      xmlns:dc="http://purl.org/dc/elements/1.1/"
       xmlns:atom="http://www.w3.org/2005/Atom">
    <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 %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&format=rss2</link>
-     <atom:link rel="self" type="application/rss+xml" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&format=rss2" />
+     <atom:link rel="self" type="application/rss+xml" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&sort_by=[% sort_by |html %]&format=rss2"/>
      <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 %]</opensearch:totalResults>
      <opensearch:startIndex>[% offset %]</opensearch:startIndex>
@@ -27,20 +28,19 @@
      [% ELSE %]
        <opensearch:itemsPerPage>20</opensearch:itemsPerPage>
      [% END %]
-     <atom:link rel="search" type="application/opensearchdescription+xml" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?format=opensearchdescription"/>
-     <opensearch:Query role="request" searchTerms="[% query_desc |html %] [% limit_desc |html %]" startPage="[% page %]" />
 	 [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
+     <atom:link rel="search" type="application/opensearchdescription+xml" href="[% SEARCH_RESULT.OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% SEARCH_RESULT.query_cgi |html %][% SEARCH_RESULT.limit_cgi |html %]&sort_by=[% SEARCH_RESULT.sort_by |html %]&format=opensearchdescription"/>
+     <opensearch:Query role="request" searchTerms="[% SEARCH_RESULT.query_desc |url %][% SEARCH_RESULT.limit_desc |url %]" startPage="[% SEARCH_RESULT.page %]" />
      <item>
        <title>[% SEARCH_RESULT.title |html %] [% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl.subfield |html %][% END %]</title>
-       <isbn>[% SEARCH_RESULT.isbn |html %]</isbn>
+       <dc:identifier>ISBN [% SEARCH_RESULT.isbn |html %]</dc:identifier>
        <link>[% IF ( SEARCH_RESULT.BiblioDefaultViewmarc ) %][% OPACBaseURL %]/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %][% ELSE %][% IF ( SEARCH_RESULT.BiblioDefaultViewisbd ) %][% OPACBaseURL %]/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %][% ELSE %][% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %][% END %][% END %]</link>
        <description><![CDATA[
 [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" />[% END %][% END %][% END %]
-
-[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( SEARCH_RESULT.content_identifier_exists ) %][% IF ( using_https ) %]<img src="https://secure.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% SEARCH_RESULT.normalized_upc %]&oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" />
+[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( SEARCH_RESULT.content_identifier_exists ) %]<img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&client=[% SEARCH_RESULT.SyndeticsClientCode %]&type=xw10[% IF ( SEARCH_RESULT.normalized_upc ) %]&upc=[% SEARCH_RESULT.normalized_upc %][% END %][% IF ( SEARCH_RESULT.normalized_oclc ) %]&oclc=[% SEARCH_RESULT.normalized_oclc %][% END %]" alt="" />
 [% ELSE %]
 <img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% SEARCH_RESULT.normalized_upc %]&oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" />
-[% END %][% END %][% END %][% END %]
+[% END %][% END %][% END %]
 
 [% IF ( BakerTaylorEnabled ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% SEARCH_RESULT.normalized_isbn %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL |html %][% SEARCH_RESULT.normalized_isbn %]" /></a>[% END %][% END %]
 	   <p>[% IF ( SEARCH_RESULT.author ) %]By [% SEARCH_RESULT.author |html %]. [% END %]
@@ -51,7 +51,7 @@
                         [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size |html %]. [% END %]
                         [% IF ( SEARCH_RESULT.isbn ) %] [% SEARCH_RESULT.isbn |html %][% END %] </p><p>
 [% IF ( RequestOnOpac ) %]
-<a href="[% OPACBaseURL %]/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Place Hold on <i>[% SEARCH_RESULT.title |html %]</i></a></p>
+<a href="[% SEARCH_RESULT.OPACBaseurl %]/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Place Hold on <i>[% SEARCH_RESULT.title %]</i></a></p>
 [% END %]
 						]]></description>
        <guid>[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]</guid>
@@ -80,12 +80,12 @@
      <opensearch:itemsPerPage>20</opensearch:itemsPerPage>
    [% END %]
    <opensearch:Query role="request" searchTerms="[% query_desc |html %] [% limit_desc |html %]" startPage="[% page |html %]" />
-   <link rel="alternate" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]pw=[% page %]" type="text/html"/>
+   <link rel="alternate" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=[% page %]&format=atom" type="application/atom+xml"/>
    <link rel="self" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]&format=atom" type="application/atom+xml"/>
    <link rel="first" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=1&format=atom" type="application/atom+xml"/>
    <link rel="previous" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=2&format=atom" type="application/atom+xml"/>
    <link rel="next" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=4&format=atom" type="application/atom+xml"/>
-   <link rel="last" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]pw=42299&format=atom" type="application/atom+xml"/>
+   <link rel="last" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=42299&format=atom" type="application/atom+xml"/>
    <link rel="search" type="application/opensearchdescription+xml" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?format=opensearchdescription"/>
 
    [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
-- 
1.7.5.4


More information about the Patches mailing list