Bugzilla – Attachment 76160 Details for
Bug 16111
RSS feed for OPAC search results has wrong content type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16111: Fix content type for RSS feed
Bug-16111-Fix-content-type-for-RSS-feed.patch (text/plain), 2.03 KB, created by
Jonathan Druart
on 2018-06-18 20:51:33 UTC
(
hide
)
Description:
Bug 16111: Fix content type for RSS feed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-06-18 20:51:33 UTC
Size:
2.03 KB
patch
obsolete
>From a8375871f667e75fcdaa38813902facb1a1eee41 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 18 Jun 2018 17:31:27 -0300 >Subject: [PATCH] Bug 16111: Fix content type for RSS feed > >Test plan: >GET http://catalogue/cgi-bin/koha/opac-search.pl?idx=kw&q=perl&count=50&sort_by=acqdate_dsc&format=rss2 > >=> Without this patch it returns content type text/html >=> With this patch it returns text/xml > >GET http://catalogue/cgi-bin/koha/opac-search.pl?idx=kw&q=perl&count=50&sort_by=acqdate_dsc&format=rss >=> Without this patch it does not work >=> With this patch it returns text/xml >--- > opac/opac-search.pl | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 1d7615bc5c..b6dc9fe785 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -115,6 +115,9 @@ else { > $template_name = 'opac-advsearch.tt'; > $template_type = 'advsearch'; > } >+ >+$format = 'rss' if $format =~ /rss/; >+ > # load the template > ($template, $borrowernumber, $cookie) = get_template_and_user({ > template_name => $template_name, >@@ -138,7 +141,7 @@ if($cgi->cookie("bib_list")){ > @cart_list = split(/\//, $cart_list); > } > >-if ($format eq 'rss2' or $format eq 'opensearchdescription' or $format eq 'atom') { >+if ($format eq 'rss' or $format eq 'opensearchdescription' or $format eq 'atom') { > $template->param($format => 1); > $template->param(timestamp => strftime("%Y-%m-%dT%H:%M:%S-00:00", gmtime)) if ($format eq 'atom'); > # FIXME - the timestamp is a hack - the biblio update timestamp should be used for each >@@ -735,7 +738,7 @@ for (my $i=0;$i<@servers;$i++) { > } > > ## If there's just one result, redirect to the detail page >- if ($total == 1 && $format ne 'rss2' >+ if ($total == 1 && $format ne 'rss' > && $format ne 'opensearchdescription' && $format ne 'atom') { > my $biblionumber=$newresults[0]->{biblionumber}; > if (C4::Context->preference('BiblioDefaultView') eq 'isbd') { >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16111
:
49400
|
49587
|
49629
|
49837
|
76148
|
76160
|
76161
|
76162
|
77057
|
77058
|
77059
|
77060
|
78578
|
78579
|
78580
|
78581
|
78689
|
81285
|
81286
|
81287
|
81288
|
92050
|
92362
|
92363
|
92366
|
92435
|
92436
|
92437
|
92438
|
92439
|
92618
|
92619
|
92620
|
92621
|
92622
|
92623
|
92624