From a1e1384b72aad0d43256c2672e1e524969565c8b Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 16 Jan 2023 06:03:13 +0000 Subject: [PATCH] Bug 32639: Send opac-search.osdx without doing an empty search This patch sends out opac-search.osdx without running the entirety of opac-search.pl without any search query. This prevents unnecessary computations and warnings from appearing in the logs. Test plan: 1. Apply patch 2. Go to http://kohadev.myDNSname.org:8080/cgi-bin/koha/opac-search.pl?format=opensearchdescription 3. Note that no errors appear in /var/log/koha/kohadev/plack-opac-error.log 4. Verify that opac-search.pl still works as expected when doing a search via the web UI Signed-off-by: David Nind --- opac/opac-search.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 10dc707a3e..65904676d1 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -142,10 +142,19 @@ if($cgi->cookie("bib_list")){ if ($format eq 'rss' or $format eq 'opensearchdescription' or $format eq 'atom') { $template->param($format => 1); + #NOTE: opensearchdescription doesn't actually use timestamp... $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 # entry, but not sure if that's worth an extra database query for each bib } + +#NOTE: Return now for 'opensearchdescription' BZ 32639 +if ( $format && $format eq 'opensearchdescription' ){ + my $content_type = $format; + output_with_http_headers $cgi, $cookie, $template->output, $content_type; + exit; +} + if (C4::Context->preference("marcflavour") eq "UNIMARC" ) { $template->param('UNIMARC' => 1); } -- 2.30.2