Bug 39589 - Search returns 'No results found' despite existing matching records
Summary: Search returns 'No results found' despite existing matching records
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Hammat wele
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-09 00:09 UTC by Hammat wele
Modified: 2025-05-14 14:13 UTC (History)
6 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 39589: OPAC search returns 'No results found' despite existing matching records (4.12 KB, patch)
2025-04-09 00:18 UTC, Hammat wele
Details | Diff | Splinter Review
Bug 39589: OPAC search returns 'No results found' despite existing matching records (4.13 KB, patch)
2025-04-09 01:00 UTC, Hammat wele
Details | Diff | Splinter Review
Bug 39589: OPAC search returns 'No results found' despite existing matching records (4.18 KB, patch)
2025-05-11 21:33 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Hammat wele 2025-04-09 00:09:56 UTC
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".
       ---> The message "No results found!" appears, and "notice test 6" is not visible.
Comment 1 Hammat wele 2025-04-09 00:18:45 UTC Comment hidden (obsolete)
Comment 2 Hammat wele 2025-04-09 01:00:42 UTC
Created attachment 180738 [details] [review]
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"
Comment 3 David Nind 2025-05-11 21:33:26 UTC
Created attachment 182240 [details] [review]
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>
Comment 4 David Nind 2025-05-11 21:35:46 UTC
I've signed off, as everything works as per the test plan.

However, I would find it confusing to see (after the patch):
- Your search returned 6 results.
- Only one result showing.

But I also understand that hiding records and items in the OPAC is "difficult" 8-).
Comment 5 David Nind 2025-05-11 21:37:03 UTC
I changed to a normal bug, instead of an enhancement. (It is something that is not working (that is, showing showing results), when it should.)
Comment 6 Jonathan Druart 2025-05-14 14:13:05 UTC
Please setup the pre-commit git hook and do not forget to run the QA script.

 FAIL   koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
   FAIL   tidiness
                File is not tidy, please run `perl misc/devel/tidy.pl koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt`