Bug 30844 - The OPAC detail page's browser is limited to the current page of results when using Elasticsearch
Summary: The OPAC detail page's browser is limited to the current page of results when...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Kevin Carnes
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-25 10:53 UTC by Kevin Carnes
Modified: 2023-06-08 22:26 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00, 22.05.01, 21.11.07
Circulation function:


Attachments
Bug 30844: The OPAC detail page's browser is limited to the current page of results when using Elasticsearch (2.68 KB, patch)
2022-05-25 10:58 UTC, Kevin Carnes
Details | Diff | Splinter Review
Bug 30844: The OPAC detail page's browser is limited to the current page of results when using Elasticsearch (2.72 KB, patch)
2022-05-31 02:11 UTC, David Nind
Details | Diff | Splinter Review
Bug 30844: The OPAC detail page's browser is limited to the current page of results when using Elasticsearch (2.78 KB, patch)
2022-06-06 12:56 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 30844: Use XML::Dumper instead of JSON to allow encoding scalar queries (2.36 KB, patch)
2022-06-08 13:38 UTC, Kevin Carnes
Details | Diff | Splinter Review
Bug 30844: Ensure that allow_nonref is enabled when using older versions of JSON (2.05 KB, patch)
2022-06-09 06:14 UTC, Kevin Carnes
Details | Diff | Splinter Review
Bug 30844: Ensure that allow_nonref is enabled when using older versions of JSON (2.14 KB, patch)
2022-06-09 06:21 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Carnes 2022-05-25 10:53:42 UTC
When viewing the detail page of the first or last record of a result page, it's not possible to browse to another page when using Elasticsearch.
Comment 1 Kevin Carnes 2022-05-25 10:58:32 UTC
Created attachment 135336 [details] [review]
Bug 30844: The OPAC detail page's browser is limited to the current page of results when using Elasticsearch

When viewing the detail page of the first or last record of a result page,
it's not possible to browse to another page when using Elasticsearch.

To test:
1) Search for "*" in the OPAC
2) Click on the last result of the page
3) Observe that you cannot browse to the next page
4) Apply the patch
5) Search for "*" in the OPAC
6) Click on the last result of the page
7) Observe that you can browse to the next page
8) Sign off

Sponsored-by: Lund University Library
Comment 2 David Nind 2022-05-31 02:11:59 UTC
Created attachment 135456 [details] [review]
Bug 30844: The OPAC detail page's browser is limited to the current page of results when using Elasticsearch

When viewing the detail page of the first or last record of a result page,
it's not possible to browse to another page when using Elasticsearch.

To test:
1) Search for "*" in the OPAC
2) Click on the last result of the page
3) Observe that you cannot browse to the next page
4) Apply the patch
5) Search for "*" in the OPAC
6) Click on the last result of the page
7) Observe that you can browse to the next page
8) Sign off

Sponsored-by: Lund University Library

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2022-06-06 12:56:30 UTC
Hi Kevin, now we meet here too :)
Comment 4 Katrin Fischer 2022-06-06 12:56:57 UTC
Created attachment 135727 [details] [review]
Bug 30844: The OPAC detail page's browser is limited to the current page of results when using Elasticsearch

When viewing the detail page of the first or last record of a result page,
it's not possible to browse to another page when using Elasticsearch.

To test:
1) Search for "*" in the OPAC
2) Click on the last result of the page
3) Observe that you cannot browse to the next page
4) Apply the patch
5) Search for "*" in the OPAC
6) Click on the last result of the page
7) Observe that you can browse to the next page
8) Sign off

Sponsored-by: Lund University Library

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Tomás Cohen Arazi (tcohen) 2022-06-06 14:57:32 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 6 Marcel de Rooy 2022-06-08 11:27:56 UTC
(In reply to Tomás Cohen Arazi from comment #5)
> Pushed to master for 22.11.
> 
> Nice work everyone, thanks!

Hmm

13:22] <marcelr> hash- or arrayref expected (not a simple scalar, use allow_nonref to allow this) at /usr/share/koha/opac/opac-search.pl line 564
[13:26] <marcelr> Commit 71f54a75713c5d5a6acfbdd3fefe1166ea0efafd
[13:26] <marcelr> -    $pasarParams .= '&amp;query=' . uri_escape_utf8($query); +    $pasarParams .= '&amp;query=' . uri_escape_utf8(encode_json($query));
[13:26] <marcelr> a simple opac search already crashes on master
Comment 7 Marcel de Rooy 2022-06-08 11:28:50 UTC
Using Zebra !
Comment 8 Katrin Fischer 2022-06-08 11:30:35 UTC
Sorry for that, I thought I had done the test with Zebra as well :(
Comment 9 Kevin Carnes 2022-06-08 13:38:02 UTC
Created attachment 135807 [details] [review]
Bug 30844: Use XML::Dumper instead of JSON to allow encoding scalar queries
Comment 10 Kevin Carnes 2022-06-08 13:45:34 UTC
I forgot to check Zebra. JSON has allow_nonref enabled by default starting with version 4. It seems easier to just use XML::Dumper instead of enabling allow_nonref in JSON.
Comment 11 Kevin Carnes 2022-06-09 06:14:34 UTC
Created attachment 135852 [details] [review]
Bug 30844: Ensure that allow_nonref is enabled when using older versions of JSON
Comment 12 Marcel de Rooy 2022-06-09 06:20:11 UTC
(In reply to Kevin Carnes from comment #11)
> Created attachment 135852 [details] [review] [review]
> Bug 30844: Ensure that allow_nonref is enabled when using older versions of
> JSON

Thanks
Comment 13 Marcel de Rooy 2022-06-09 06:21:11 UTC
Created attachment 135853 [details] [review]
Bug 30844: Ensure that allow_nonref is enabled when using older versions of JSON

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 14 Marcel de Rooy 2022-06-09 06:22:23 UTC
@RM: Tomas, push the last follow-up please.
Confirming that this resolves the OPAC crash on search for Debian 10.
Comment 15 Tomás Cohen Arazi (tcohen) 2022-06-09 12:39:31 UTC
Follow-up pushed to master for 22.11.

Nice work everyone, thanks!

I also forgot to test the Zebra use case.
Comment 16 Lucas Gass (lukeg) 2022-06-17 20:19:15 UTC
Pushed to 22.05.x for 22.05.01
Comment 17 Arthur Suzuki 2022-06-21 14:07:54 UTC
thx! pushed to 21.11.x for 21.11.07
Comment 18 Victor Grousset/tuxayo 2022-06-26 00:15:24 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Nothing to document, marking resolved.