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.
Created attachment 25959 [details] [review] Bug 11909 - Fix hidelostitems, OpacHiddenItems total count, prog theme facet display This patch is combined because testing all three as they interact may be complicated enough and the changes are minimal. - Stopped hiding biblio when an item is lost. - Inspected all items to determine if all are hidden to "hide" a biblio. (I left it so that if a non-hidden item exists, such as another branches' item is not hidden, the biblio will still show.) - Tweaked prog theme to only show facets if the search results count > 0 Bugs that may be affected: 8462 - hopefully can be obsoleted by this 9966 - can be obsoleted (4004 not found with single result for OpacHiddenItems) 8416 - hopefully can be obsoleted by this. OpacHiddenItems is orthogonal to hidelostitems, and this patch separates function more. 3194 - obsolete. I think we want to see the biblio these days. And facets display provides the further filtering functionality these days. 11489 - obsolete - no 404 not found errors anymore Other bugs to consider 3030, 11677 Testing: (Sometimes requires periodic rebuild_zebra.pl -a -b -r as Search search_results might affect what gets indexed.) I had a blank test DB with DOM, and default reference test data loaded. I used Z3950 to catalog 3 biblios and set the title to have something unique (like xyzzy). I would typically search for "xzzy" all the time. You can run or watch zerbasrv -f KOHA_CONF to see how many results are returned and observe the further filtering by hidden/lost items. Out of the three cataloged, I added two items from library CPL to one, One with a CPL and MPL item, and One with a MPL only. I also would navigate to admin and change lost status of various items and switch to another tab and runthe search. Note: You might need to rebuld zebra in some cases, that is whay i suggested a small size database. If you already have a large DB with known branches and lost items, you can just query for things, comparing to the query results in the staff client. I did not test multiple pages/paging of results, since the patch seemed minimal, but someone else could. Note: I though about the hiding of biblios for OpacHiddenItems across federated/multiple server searches, and I did not address that case. But that is a more complex scenario. Reading different bugs about hiding biblios for all items being lost, with differing opinons, I chose to provide the biblios and rely on the faceted availability to futher filter those out. Hope thats a good compromise. We could add a syspref for availability to default differently if folks want that.
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.
We've dialogued on this. Awaiting some tweaks. :)
(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.
You could syspref the addition of hideatopac for lostitems, wajasu. That would give the option to hide or not hide the biblio. :)
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.
Did I miss the "ball in my court" signal?
# TODO: get hidden tag mapping Indeed, I think we need a mapping in biblio or biblioitems like opachidden.
Should this be "Needs signoff"?
Can we get a test plan for this patch? Thanks!
Anyone is working on this? Still valid in 16.11. Regards, Marjorie
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?
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.
Ah, yes that probably would be helpful to know! We're using OpacHiddenItems. Should I log a separate bug just for that?
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?
(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!
(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!
Sounds like this one is resolved.. marking as such.