Bug 11909 - Fix hidelostitems, OpacHiddenItems total count, prog them facet display
Summary: Fix hidelostitems, OpacHiddenItems total count, prog them facet display
Status: CLOSED WORKSFORME
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: wajasu
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-07 18:12 UTC by wajasu
Modified: 2020-11-30 21:45 UTC (History)
12 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 11909 - Fix hidelostitems, OpacHiddenItems total count, prog theme facet display (2.58 KB, patch)
2014-03-07 19:34 UTC, wajasu
Details | Diff | Splinter Review
Bug-11909-Fix-hidelostitems-OpacHiddenItems-total-count facets, prog theme (18.10 KB, patch)
2014-03-17 02:32 UTC, wajasu
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description wajasu 2014-03-07 18:12:41 UTC
hidelostitems hides the biblio when all items are lost.
  - we just want to hide the items, not the biblio.
  - one can use the Availability Refine your search to hide the biblios, so
    that functionality provides the feature, without a default hiding of biblios.

opac-search.pl search results calculates wrong "total" so that Number of results found indicator is off, and is misreported, as well as breaks auto-redirect to details when ONLY one result is returned, with various combinations of usage of hidelostitems, and OpacHiddenItems.

facets "Refine your serach" displays in "prog" theme when no search results returned.
- this seemd fine in bootstrap theme.
Comment 1 wajasu 2014-03-07 19:34:27 UTC Comment hidden (obsolete)
Comment 2 wajasu 2014-03-07 19:39:41 UTC
For branch hiding typically would add:
homebranch: [MPL]
to OpacHiddenItems.

Used homebranch: [CPL,MPL]  to get all my branches hidden.
You could use holdingbranch, and other rules.  Be aware, of your logged in user in the OPAC, and anonymous user.  I'm not sure about how the home branch is cached. Sometimes things get no results because you might not get OpacHiddenItems correct.
Comment 3 Mark Tompsett 2014-03-08 05:47:23 UTC
We've dialogued on this. Awaiting some tweaks. :)
Comment 4 Galen Charlton 2014-03-11 22:46:25 UTC
(In reply to wajasu from comment #0)
> hidelostitems hides the biblio when all items are lost.
>   - we just want to hide the items, not the biblio.

Actually... I don't think that can be assumed.  Some libraries are might want such bibs to display, others are pretty much of the mindset to not display in the catalog titles that a patron can't request right away.

>   - one can use the Availability Refine your search to hide the biblios, so
>     that functionality provides the feature, without a default hiding of
> biblios.

Again, this is a question of library policy, and the question should be broadly asked.
Comment 5 Mark Tompsett 2014-03-12 02:37:24 UTC
You could syspref the addition of hideatopac for lostitems, wajasu. That would give the option to hide or not hide the biblio. :)
Comment 6 wajasu 2014-03-17 02:32:15 UTC
Created attachment 26393 [details] [review]
Bug-11909-Fix-hidelostitems-OpacHiddenItems-total-count facets, prog theme

Fix hidden items handling to set a tag 999h=1 for the biblio in rebuild_zebra.pl
thus moving relavant items querying to rebuild_zebra.pl (for exported biblios).
Fix facets building counters to leverage looking at the tag in the marc record
getRecords method which feeds into searchResults.
Added the hiding of branch/library facet when OpacHiddenItems rules specify the
holdingbranch hidden.
Fix searchResults to hide biblio results accordingly.
Hopefully a perfomance improvement for searches since excessive database item
queries are done once at index build.
    
This patch lays the groundwork for: correct facet counting, and hooks for
patron category hiding rules, and opac supress without the need for and
extra zebra index.
    
This patch is a work in progress validation of this strategy before adding
all the other features and fixes on deck.

Once I have this patch somewhat verified with mtompset or others, I will add a bunch of other fixes.

This patch:
- biblio in results are hidden if all its items are hidden.
  (not hidden if a lost or item exists from another branch)
- facets counters should be aligned with results

It would be nice to see if this perform better for folks with a large database.
Comment 7 Mark Tompsett 2014-03-31 18:43:15 UTC
Did I miss the "ball in my court" signal?
Comment 8 Fridolin Somers 2014-07-10 08:34:00 UTC
# TODO: get hidden tag mapping
Indeed, I think we need a mapping in biblio or biblioitems like opachidden.
Comment 9 Magnus Enger 2015-03-26 09:50:03 UTC
Should this be "Needs signoff"?
Comment 10 Kyle M Hall 2016-02-16 15:09:45 UTC
Can we get a test plan for this patch?

Thanks!
Comment 11 Marjorie Barry-Vila 2017-10-20 13:58:59 UTC
Anyone is working on this?

Still valid in 16.11.

Regards,
Marjorie
Comment 12 Hugh Rundle 2018-04-19 23:27:51 UTC
Can confirm this is still a problem: titles where all items are hidden still appear in search results, then when you click on it you get a 404 (of course). If you can't reach the title description it shouldn't appear in results.

Anyone on this?
Comment 13 Katrin Fischer 2018-04-21 10:59:00 UTC
Hi Hugh, how are you hiding them? OpacSuppression, OpacHiddenItems or in another way? This bug seems to a bit confusing, maybe filing  new one with a clear way on how to see the issue would be better.
Comment 14 Hugh Rundle 2018-04-22 22:45:48 UTC
Ah, yes that probably would be helpful to know! We're using OpacHiddenItems. Should I log a separate bug just for that?
Comment 15 Katrin Fischer 2018-04-23 05:19:24 UTC
Hi Hugh, I've just tested the behaviour on master and things behave correctly for me: if all items are hidden with OpacHiddenItems the record doesn't show in the result list. Only when you try to get to it using a direct link the 404 is shown. If only some items are hidden, the record remains visible and only the items are hidden. Can you retest?
Comment 16 Hugh Rundle 2018-04-23 22:37:43 UTC
(In reply to Katrin Fischer from comment #15)
> Hi Hugh, I've just tested the behaviour on master and things behave
> correctly for me: if all items are hidden with OpacHiddenItems the record
> doesn't show in the result list. Only when you try to get to it using a
> direct link the 404 is shown. If only some items are hidden, the record
> remains visible and only the items are hidden. Can you retest?

Hmm, I've tested this again and you're right. Possibly we had a local caching issue. Apologies for the red herring!
Comment 17 Katrin Fischer 2018-04-24 06:23:07 UTC
(In reply to Hugh Rundle from comment #16)

> Hmm, I've tested this again and you're right. Possibly we had a local
> caching issue. Apologies for the red herring!

Np, glad it works!
Comment 18 Martin Renvoize 2019-11-07 09:19:53 UTC
Sounds like this one is resolved.. marking as such.