Bug 11432 - 404.pl redirect for single, hidden result makes no sense.
Summary: 404.pl redirect for single, hidden result makes no sense.
Status: RESOLVED DUPLICATE of bug 11489
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Mark Tompsett
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-20 20:58 UTC by Mark Tompsett
Modified: 2014-01-14 17:49 UTC (History)
4 users (show)

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


Attachments
Bug 11432 - 404.pl redirect for single, hidden result makes no sense. (1.82 KB, patch)
2013-12-20 21:02 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 11432 - 404.pl redirect for single, hidden result makes no sense. (1.89 KB, patch)
2013-12-31 21:31 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 11432 - 404.pl redirect for single, hidden result makes no sense. (1.94 KB, patch)
2014-01-09 16:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11432: Show facets only if there is result to display (1.53 KB, patch)
2014-01-09 16:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED OFF] Bug 11432: Show facets only if there is result to display (1.52 KB, patch)
2014-01-14 17:38 UTC, Mark Tompsett
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Tompsett 2013-12-20 20:58:23 UTC
In bug 10584, when searching for something in OPAC and a single, hidden result is returned, the default automatic redirect to the details/MARCdetails/ISBDdetails page triggers a 404.pl error page. This makes no sense. The correct behaviour would be to give no results.

TEST PLAN
---------
1) OPAC Search for something (I started with stupid)
2) Narrow it to one item (I tweaked it to stupid things)
3) Detail page comes up
4) Staff client -> home -> administration -> global system preferences -> OPAC
5) OpacHiddenItems add "homebranch: [MAL,DAV,PAP]", changing MAL, DAV, PAP to the branches for items for this single biblio.
6) Search for the one item again in OPAC
-- 404.pl is triggered.
4) Apply patch
5) Search again for the one item search
-- No results is triggered (as expected)
Comment 1 Mark Tompsett 2013-12-20 21:02:47 UTC Comment hidden (obsolete)
Comment 2 Biblibre Sandboxes 2013-12-31 21:30:27 UTC
Patch tested with a sandbox, by Christopher Brannon <cbrannon@cdalibrary.org>
Comment 3 Biblibre Sandboxes 2013-12-31 21:31:12 UTC Comment hidden (obsolete)
Comment 4 Christopher Brannon 2013-12-31 21:32:29 UTC
Patch works according to test plan.

Christopher
Comment 5 Jonathan Druart 2014-01-09 16:54:43 UTC
Created attachment 24101 [details] [review]
Bug 11432 - 404.pl redirect for single, hidden result makes no sense.

In bug 10584, when searching for something in OPAC and a single,
hidden result is returned, the default automatic redirect to
the details/MARCdetails/ISBDdetails page triggers a 404.pl
error page. This makes no sense. The correct behaviour would
be to give no results.

TEST PLAN
---------
1) OPAC Search for something (I started with stupid)
2) Narrow it to one item (I tweaked it to stupid things)
3) Detail page comes up
4) Staff client -> home -> administration ->
    global system preferences -> OPAC
5) OpacHiddenItems add "homebranch: [MAL,DAV,PAP]",
    changing MAL, DAV, PAP to the branches for items for this
    single biblio.
6) Search for the one item again in OPAC
   -- 404.pl is triggered.
4) Apply patch
5) Search again for the one item search
   -- No results is triggered (as expected)

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 6 Jonathan Druart 2014-01-09 16:55:31 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2014-01-09 16:57:10 UTC
I added a followup in order to hide the facets block if no result is displayed.

Marked as Passed QA.
Comment 8 Galen Charlton 2014-01-09 20:15:02 UTC
I'm failing this because it doesn't address the root cause, which is that opac-search.pl is failing to count hits correctly when bibs get filtered out because all of their items are hidden.  To see what I mean, try the following test:

[1] Arrange a search that returns two hits.
[2] Edit the items on one of the bibs so that all of them would be hidden.
[3] Run the search.  The OPAC will report two hits, but display a result list containing only one hit.  It should actually be redirecting to that bib.

The root issue is described in bug 8462.  Putting aside the notion of further work to materialize the hidden status of the items attached to a bib so that the search engine can filter them out automatically, I think there's room for a patch for that bug that simply arranges so that $total and $hits are calculated correctly; I think that it is a far less productive direction to pile on more code that attempts to work around $total being incorrect.

Jonathan: regarding your follow-up, one thing to note is that the Bootstrap theme already
Comment 9 Mark Tompsett 2014-01-12 04:03:52 UTC
Galen, is 11489 the type of patch you were talking about on the IRC channel? If so, perhaps Jonathan Druart's patch combined with 11489 would be the proper solution?
Comment 10 Mark Tompsett 2014-01-14 17:38:23 UTC
Created attachment 24293 [details] [review]
[SIGNED OFF] Bug 11432: Show facets only if there is result to display

If all results are hidden, the facets are displayed.

With this patch, the facets are hidden too.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 11 Mark Tompsett 2014-01-14 17:49:32 UTC
I moved the second patch to bug 11489, and I believe it solves the issues from bug 10584 as well.

*** This bug has been marked as a duplicate of bug 11489 ***