Bugzilla – Attachment 182240 Details for
Bug 39589
Search returns 'No results found' despite existing matching records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39589: OPAC search returns 'No results found' despite existing matching records
Bug-39589-OPAC-search-returns-No-results-found-des.patch (text/plain), 4.18 KB, created by
David Nind
on 2025-05-11 21:33:26 UTC
(
hide
)
Description:
Bug 39589: OPAC search returns 'No results found' despite existing matching records
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-05-11 21:33:26 UTC
Size:
4.18 KB
patch
obsolete
>From 6fdd5031c4eadc71df865c7b3645e60223f910f3 Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Wed, 9 Apr 2025 00:59:57 +0000 >Subject: [PATCH] Bug 39589: OPAC search returns 'No results found' despite > existing matching records > >This issue occurs when the records on the first page of results are not displayed. The message "No results found" is shown, and it is not possible to access records on other pages. > >To test > > 1. Set the following system preferences: > OPACnumSearchResults to 5 > OpacHiddenItemsHidesRecord to Hide > OpacHiddenItems to withdrawn: [1] > 2. Create 6 bibliographic records with the following titles: > "notice test 1" > "notice test 2" > "notice test 3" > "notice test 4" > "notice test 5" > "notice test 6" > 3. For the first 5 records, add an item with Withdrawn status. > 4. For "notice test 6", add an item with Available status. > 5. In the OPAC interface, search for "notice test". > 6. Apply the patch > 7. Repeat step 4 > ---> The results table is now shown with the message: "Search results on this page are not available." > ---> You can now access the second page and see "notice test 6" > >Signed-off-by: David Nind <david@davidnind.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 7 +++++++ > opac/opac-search.pl | 4 +++- > 2 files changed, 10 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index f05b1fccd2..93a1259060 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -192,6 +192,7 @@ > <div id="floating" class="sticky"> > <div id="toolbar" class="toolbar row align-items-center"> > <div id="top-pages" class="col"> [% INCLUDE 'page-numbers.inc' %] </div> >+ [% UNLESS no_result %] > [% UNLESS tag %] > <div class="sort_by col-sm-auto"> > <label for="sort_by" class="sr-only">Sort by:</label> >@@ -223,13 +224,18 @@ > </div> > <!-- /.sort_by --> > [% END # /UNLESS tag %] >+ [% END %] > </div> > <!-- / #toolbar --> > > [% INCLUDE 'result-batch-controls.inc' results=1 %] >+ [% IF no_result %] >+ <p>Search results on this page are not available.</p> >+ [% END %] > </div> > <!-- /#floating --> > >+ [% UNLESS no_result %] > <!-- TABLE RESULTS START --> > <table class="table table-striped"> > <caption class="sr-only">Results</caption> >@@ -418,6 +424,7 @@ > </tr> > [% END # / FOREACH SEARCH_RESULT %] > </table> >+ [% END %] > </form> > <!-- / #bookbag_form --> > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index ece6ba64b8..b94eed69a5 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -670,7 +670,9 @@ for ( my $i = 0 ; $i < @servers ; $i++ ) { > $search_context, $query_desc, $hits, $results_per_page, $offset, $scan, > $results_hashref->{$server}->{"RECORDS"}, $variables > ); >- $hits = 0 unless @newresults; >+ unless (@newresults) { >+ $template->param( no_result => 1 ); >+ } > > my $art_req_itypes; > if ( C4::Context->preference('ArticleRequests') ) { >-- >2.39.5
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 39589
:
180737
|
180738
| 182240