Bugzilla – Attachment 180737 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.12 KB, created by
Hammat wele
on 2025-04-09 00:18:45 UTC
(
hide
)
Description:
Bug 39589: OPAC search returns 'No results found' despite existing matching records
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2025-04-09 00:18:45 UTC
Size:
4.12 KB
patch
obsolete
>From 268fce8f625c7236a1535ffdc3ff52cac674b645 Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Wed, 9 Apr 2025 00:18:14 +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" >--- > 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 2cfd946085..a5a94e2579 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 %] >+ Search results on this page are not available. >+ [% 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 9f906784c9..4e105eaa2a 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.34.1
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