Bug 32639 - OpenSearch description format document generates search errors
Summary: OpenSearch description format document generates search errors
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: David Cook
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-16 05:23 UTC by David Cook
Modified: 2023-12-28 20:42 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.04,22.05.11,21.11.19


Attachments
Bug 32639: Send opac-search.osdx without doing an empty search (1.77 KB, patch)
2023-01-16 06:05 UTC, David Cook
Details | Diff | Splinter Review
Bug 32639: Send opac-search.osdx without doing an empty search (1.82 KB, patch)
2023-01-17 08:39 UTC, David Nind
Details | Diff | Splinter Review
Bug 32639: Send opac-search.osdx without doing an empty search (1.95 KB, patch)
2023-02-23 09:47 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2023-01-16 05:23:53 UTC
I noticed going to http://localhost:8080/ in Chrome caused the following to appear in /var/log/koha/kohadev/plack-opac-error.log:

[2023/01/16 04:58:40] [WARN] WARNING: query problem with   ZOOM error 10014 "CCL parsing error" (addinfo: "Search word expected") from diag-set 'ZOOM' at 
/kohadevbox/koha/C4/Search.pm line 352.
[2023/01/16 04:58:40] [WARN] Use of uninitialized value $hits in numeric eq (==) at /kohadevbox/koha/opac/opac-search.pl line 613.
[2023/01/16 04:58:40] [WARN] Use of uninitialized value $times in subtraction (-) at /kohadevbox/koha/C4/Search.pm line 1712.

Of course, fixing this will require touching opac-search.pl without breaking anything...
Comment 1 David Cook 2023-01-16 05:39:20 UTC
Note that this happens with Chrome but not Firefox. I think Firefox just parses the HTML whereas Chrome seems to actually follow the link provided by the markup...
Comment 2 David Cook 2023-01-16 05:53:49 UTC
Ok now I'm only able to reproduce the on page load problem when I go to http://localhost:8080

But the same thing doesn't happen for http://kohadev.myDNSname.org:8080 

Maybe it's a caching thing. I don't know. Browsers are weird.
Comment 3 David Cook 2023-01-16 06:05:27 UTC
Created attachment 145330 [details] [review]
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
Comment 4 David Nind 2023-01-17 08:39:59 UTC
Created attachment 145352 [details] [review]
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 <david@davidnind.com>
Comment 5 Jonathan Druart 2023-02-23 09:47:19 UTC
Created attachment 147208 [details] [review]
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 <david@davidnind.com>

JD Amended patch: remove ref to bug number, we use git!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Tomás Cohen Arazi 2023-03-02 12:39:31 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 7 Matt Blenkinsop 2023-03-03 12:06:02 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 8 Lucas Gass 2023-03-10 14:50:34 UTC
Backported to 22.05.x for upcoming 22.05.11
Comment 9 Arthur Suzuki 2023-03-29 13:10:11 UTC
applied to 21.11 for 21.11.19
Comment 10 wainuiwitikapark 2023-04-27 05:37:54 UTC
Not backported to 21.05.x