When filtering OPAC searches by library (OpacAddMastheadLibraryPulldown enabled) the search results will include title records where all items for that library are hidden from the OPAC due to the values in OpacHiddenItems. When clicking through to the detailed view of an affected record the copies are correctly hidden in the holdings table but it is confusing for the library customer to find the title in the search results.
I can't replicate this problem on master. I tested with the sample data on ktd: * Activate OpacHiddenItems with: itype: [BK] * Search for Perl in the OPAC: 1 result * Search for Perl in the staff interface: 11 results * Activate OpacAddMastheadLibraryPulldown * Search for Perl with "All libraries" - 1 result * Search for Perl with "Fairview" and several other libraries: no result
Hi Katrin, thanks for testing this. I agree this works as expected if all the items attached to a particular record should be hidden. In that case I see the same results as you do. We are seeing the error when a record has multiple items. We are hiding items based on their Withdrawn status - withdrawn: [1] For example: https://elms.koha-ptfs.co.uk/cgi-bin/koha/opac-search.pl?idx=ti&q=medical+interviews+comprehensive&limit=branch%3ABHL&weight_search=1 - The search is filtered to Basildon Healthcare Library (ABH) using OpacAddMastheadLibraryPulldown. - The search returns 2 results. - The second result has available items at other libraries but the only item at Basildon is withdrawn. - The withdrawn item is not displayed (correctly) but library users find it confusing that the record is returned at all. It is felt that having a library filter on the search should prevent that record being displayed as no items are available.
Hi Lucy, ah! I understand why that would be confusing, but I am not sure how hard it would be to make it work like this. At the moment the filtering is happening independent of the search criteria. It could probably also qualify for an enhancement.
Thanks Katrin. I have marked this as an enhancement. The libraries in our larger Koha systems use the library filtering quite a bit so it would be good if opachiddenitems could be taken into account.
Hi, I've been taking a look here and this is my understanding: We want to hide the full record if no visible items match the branch filter criteria [correct me if I'm wrong please!]. The problem is, as Katrin said, the display/hiding of items is separate to the search filtering itself. This means that a search that returns 1 biblio with two items where first item is branch A and second item is branch B, it'll always return this record when filtering for branch:B, even if item B is hidden by OpacHiddenItems and only item A is shown. It's confusing because the patron filtered for B but is seeing a record only displaying one item for A. --------------------- I don't know what the immediate fix here could be, but I see a world where OpacHiddenItemsHidesRecord could be used here, since we want to hide the record based on OpacHiddenItems. Currently, OpacHiddenItemsHidesRecord hides the record only if all the items are hidden. We could add an additional logic rule to also hide the record if all displayed items don't match the 'branch:' filter. The problem with my proposed solution above is that OpacHiddenItemsHidesRecord is buggy and may cause more harm than good (see bug 35052), so unless bug 35052 progresses I don't see how we can reliably fix this.