Bug 30147

Summary: OpacBrowseResults causing error on detail page
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: OPACAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: andrewfh, fridolin.somers, kyle, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.04
Attachments: Bug 30147: Fix modules usage in opac-detail.pl
Bug 30147: Fix modules usage in opac-detail.pl
Bug 30147: Fix modules usage in opac-detail.pl

Description Katrin Fischer 2022-02-21 20:37:59 UTC
On the ktd sample database when trying to go to the detail page from the result list:

Undefined subroutine &CGI::Compile::ROOT::kohadevbox_koha_opac_opac_2ddetail_2epl::searchResults called at /kohadevbox/koha/opac/opac-detail.pl line 260

Turning off OpacBrowseResults makes the error disappear.
Comment 1 Fridolin Somers 2022-02-25 00:32:20 UTC
Created attachment 131096 [details] [review]
Bug 30147: Fix modules usage in opac-detail.pl

On the ktd sample database when trying to go to the detail page from the result list:
Undefined subroutine &CGI::Compile::ROOT::kohadevbox_koha_opac_opac_2ddetail_2epl::searchResults called at /kohadevbox/koha/opac/opac-detail.pl line 260
Turning off OpacBrowseResults makes the error disappear.

In opac-detail.pl, use C4::Search is missing searchResults and getRecords
Comment 2 Katrin Fischer 2022-02-26 16:19:41 UTC
Not a very generalized test plan yet, but what triggers it for me:

* Search for 'e' in simple search on the OPAC
* Go to page 10 using the link in the paging on top of results
* Go to any detail page from here - boom!
Comment 3 Katrin Fischer 2022-02-26 16:24:45 UTC
Created attachment 131138 [details] [review]
Bug 30147: Fix modules usage in opac-detail.pl

On the ktd sample database when trying to go to the detail page from the result list:
Undefined subroutine &CGI::Compile::ROOT::kohadevbox_koha_opac_opac_2ddetail_2epl::searchResults called at /kohadevbox/koha/opac/opac-detail.pl line 260
Turning off OpacBrowseResults makes the error disappear.

In opac-detail.pl, use C4::Search is missing searchResults and getRecords

To test:
- Search for something that gives several result pages in OPAC, example: e
- Switch to one of the last pages using link on top of results, example: 10
- Open any of the records listed in detail view
- Verify that the error is shown
- Apply patch and repeat, error is gone and browsing behaves as expected

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Martin Renvoize 2022-03-01 15:03:29 UTC
Created attachment 131186 [details] [review]
Bug 30147: Fix modules usage in opac-detail.pl

On the ktd sample database when trying to go to the detail page from the result list:
Undefined subroutine &CGI::Compile::ROOT::kohadevbox_koha_opac_opac_2ddetail_2epl::searchResults called at /kohadevbox/koha/opac/opac-detail.pl line 260
Turning off OpacBrowseResults makes the error disappear.

In opac-detail.pl, use C4::Search is missing searchResults and getRecords

To test:
- Search for something that gives several result pages in OPAC, example: e
- Switch to one of the last pages using link on top of results, example: 10
- Open any of the records listed in detail view
- Verify that the error is shown
- Apply patch and repeat, error is gone and browsing behaves as expected

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2022-03-01 15:03:50 UTC
Another trivial fix, well spotted.

PQA
Comment 6 Fridolin Somers 2022-03-04 02:12:36 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 7 Kyle M Hall 2022-03-04 15:21:31 UTC
Pushed to 21.11.x for 21.11.04
Comment 8 Andrew Fuerste-Henry 2022-03-20 16:01:09 UTC
This seems like it depends on bug 11175? Or at least needs a rebase due to changes there. Not backporting to 21.05, request if needed.