[Bug 17921] New: Shelf Browser does not take OpacSuppression or OpacHiddenItems into consideration
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Bug ID: 17921 Summary: Shelf Browser does not take OpacSuppression or OpacHiddenItems into consideration Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Items that shouldn't be displayed in the OPAC are displayed in the shelf browser The links work as expected (redirect to opac-blocked or 404) but we should not display them in the first place -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=20662 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Niamh <niamh.walker-headon@it-tallaght.ie> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |niamh.walker-headon@it-tall | |aght.ie -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Lucy Vaux-Harvey <lucy.vaux-harvey@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucy.vaux-harvey@ptfs-europ | |e.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |koha-bugs@lists.koha-commun | |ity.org -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marjorie.barry-vila@collect | |o.ca -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |patrick.robitaille@collecto | |.ca -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Ray Delahunty <r.delahunty@arts.ac.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |r.delahunty@arts.ac.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Blocks| |24403 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24403 [Bug 24403] [OMNIBUS] OpacHiddenItems should hide items everywhere in the OPAC -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Marijana Glavica <mglavica@ffzg.hr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mglavica@ffzg.hr -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Holly <hc@interleaf.ie> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hc@interleaf.ie -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 --- Comment #1 from Holly <hc@interleaf.ie> --- Hi, I just wanted to express interest in seeing this issue solved. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Resolution|--- |DUPLICATE Status|NEW |RESOLVED --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This is a duplicate of bug 28299. *** This bug has been marked as a duplicate of bug 28299 *** -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|DUPLICATE |--- Status|RESOLVED |REOPENED --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Sorry, shelves/lists vs. shelf browser. Different areas :-D -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |NEW -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29890 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- I have a local customization for this that I should really upstream one day... Although that customization is old and uses a naive/brute force approach. I have better ways of handling OpacHiddenItems these days using SQL::Abstract to write better SQL queries... -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Oh I forgot about this one. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Koha collecto <koha@collecto.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |koha@collecto.ca --- Comment #6 from Koha collecto <koha@collecto.ca> --- +1 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Gretchen Maxeiner <maxeinergl@gcc.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |maxeinergl@gcc.edu --- Comment #7 from Gretchen Maxeiner <maxeinergl@gcc.edu> --- +1. We just had this surface during a demonstration to a classful of students. Realistically we have a very small number of suppressed records, but that unfortunate glitch definitely hurt our promotion of this otherwise very useful feature. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Status|NEW |ASSIGNED -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Depends on| |43269 Patch complexity|--- |Small patch Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43269 [Bug 43269] Add cached description_for() class methods to Koha::Libraries, Koha::ItemTypes, Koha::Patron::Categories -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 --- Comment #8 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 205891 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205891&action=edit Bug 17921: Add Koha::Items->filter_by_not_suppressed This patch adds a Koha::Objects-level resultset filter that removes items whose linked biblio record is suppressed from the OPAC (i.e. the biblio.opac_suppressed column is true). It mirrors the existing Koha::Virtualshelfcontents->filter_by_not_suppressed and complements Koha::Items->filter_by_visible_in_opac, so OPAC visibility can be composed at the resultset level. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Items.t => SUCCESS: Tests pass! 3. Tests cover: - Items linked to a suppressed biblio are filtered out - The method returns a Koha::Items resultset - Only items from non-suppressed biblios are returned - All items reappear once the biblio is no longer suppressed 4. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 --- Comment #9 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 205892 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205892&action=edit Bug 17921: Make the OPAC shelf browser respect OpacHiddenItems and OpacSuppression The shelf browser (C4::ShelfBrowser::GetNearbyItems) built raw SQL against the items table and applied no OPAC visibility rules. As a result, items matching OpacHiddenItems, and items belonging to records suppressed via OpacSuppression, were displayed in the shelf browser. The links were blocked (opac-blocked or 404), but the items should not have been shown at all. This patch rewrites GetNearbyItems to build the previous/next neighbour windows using Koha::Items resultsets, so the visibility filtering is composed at the Koha::Objects level: - filter_by_visible_in_opac({ patron => $patron }) for OpacHiddenItems, OpacHiddenItemsExceptions and hidelostitems - filter_by_not_suppressed for OpacSuppression, only when suppression is in effect for the current request (C4::Context->is_opac_suppressed) Filters are applied before the neighbour window is sliced, so hidden and suppressed items are never shown as items nor used as previous/next boundary markers. The logged-in patron is now passed in from opac-detail.pl and svc/shelfbrowser.pl so category exceptions are honoured. Test plan: 1. Have OPACShelfBrowser enabled 2. Set OpacHiddenItems to hide some items, enable OpacSuppression and suppress a record whose items are shelved near a visible one 3. Open the OPAC detail page for a nearby visible item and open the shelf browser => FAIL: hidden and suppressed items are displayed in the shelf browser 4. Apply this patch, repeat from step 3 => SUCCESS: hidden and suppressed items no longer appear 5. Run: $ ktd --shell k$ prove t/db_dependent/ShelfBrowser.t => SUCCESS: Tests pass! 6. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 --- Comment #10 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 205893 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205893&action=edit Bug 17921: Use cached name_for/description_for in the shelf browser This patch makes the shelf browser reuse the cached class methods added by bug 43269 for resolving the starting shelf descriptions, instead of a direct Koha::Libraries->find and the legacy C4::Biblio::GetAuthorisedValueDesc. Changes: - Homebranch: Koha::Libraries->find(...)->branchname => Koha::Libraries->name_for - Location (LOC) and collection code (CCODE): GetAuthorisedValueDesc(...) => Koha::AuthorisedValues->description_for - Drop the now unused 'use C4::Biblio qw( GetAuthorisedValueDesc )' - No functional changes, the resolved descriptions are the same Test plan: 1. Have OPACShelfBrowser, ShelfBrowserUsesHomeBranch, ShelfBrowserUsesLocation and ShelfBrowserUsesCcode enabled 2. Open the OPAC detail page for an item and open the shelf browser 3. Notice the starting homebranch, location and ccode descriptions are shown correctly, as before 4. Run: $ ktd --shell k$ prove t/db_dependent/ShelfBrowser.t => SUCCESS: Tests pass! 5. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com | |, | |martin.renvoize@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #205891|0 |1 is obsolete| | Attachment #205892|0 |1 is obsolete| | Attachment #205893|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 --- Comment #11 from David Nind <david@davidnind.com> --- Created attachment 206201 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206201&action=edit Bug 17921: Add Koha::Items->filter_by_not_suppressed This patch adds a Koha::Objects-level resultset filter that removes items whose linked biblio record is suppressed from the OPAC (i.e. the biblio.opac_suppressed column is true). It mirrors the existing Koha::Virtualshelfcontents->filter_by_not_suppressed and complements Koha::Items->filter_by_visible_in_opac, so OPAC visibility can be composed at the resultset level. Test plan: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Items.t => SUCCESS: Tests pass! 3. Tests cover: - Items linked to a suppressed biblio are filtered out - The method returns a Koha::Items resultset - Only items from non-suppressed biblios are returned - All items reappear once the biblio is no longer suppressed 4. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 --- Comment #12 from David Nind <david@davidnind.com> --- Created attachment 206202 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206202&action=edit Bug 17921: Make the OPAC shelf browser respect OpacHiddenItems and OpacSuppression The shelf browser (C4::ShelfBrowser::GetNearbyItems) built raw SQL against the items table and applied no OPAC visibility rules. As a result, items matching OpacHiddenItems, and items belonging to records suppressed via OpacSuppression, were displayed in the shelf browser. The links were blocked (opac-blocked or 404), but the items should not have been shown at all. This patch rewrites GetNearbyItems to build the previous/next neighbour windows using Koha::Items resultsets, so the visibility filtering is composed at the Koha::Objects level: - filter_by_visible_in_opac({ patron => $patron }) for OpacHiddenItems, OpacHiddenItemsExceptions and hidelostitems - filter_by_not_suppressed for OpacSuppression, only when suppression is in effect for the current request (C4::Context->is_opac_suppressed) Filters are applied before the neighbour window is sliced, so hidden and suppressed items are never shown as items nor used as previous/next boundary markers. The logged-in patron is now passed in from opac-detail.pl and svc/shelfbrowser.pl so category exceptions are honoured. Test plan: 1. Have OPACShelfBrowser enabled 2. Set OpacHiddenItems to hide some items, enable OpacSuppression and suppress a record whose items are shelved near a visible one 3. Open the OPAC detail page for a nearby visible item and open the shelf browser => FAIL: hidden and suppressed items are displayed in the shelf browser 4. Apply this patch, repeat from step 3 => SUCCESS: hidden and suppressed items no longer appear 5. Run: $ ktd --shell k$ prove t/db_dependent/ShelfBrowser.t => SUCCESS: Tests pass! 6. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 --- Comment #13 from David Nind <david@davidnind.com> --- Created attachment 206203 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206203&action=edit Bug 17921: Use cached name_for/description_for in the shelf browser This patch makes the shelf browser reuse the cached class methods added by bug 43269 for resolving the starting shelf descriptions, instead of a direct Koha::Libraries->find and the legacy C4::Biblio::GetAuthorisedValueDesc. Changes: - Homebranch: Koha::Libraries->find(...)->branchname => Koha::Libraries->name_for - Location (LOC) and collection code (CCODE): GetAuthorisedValueDesc(...) => Koha::AuthorisedValues->description_for - Drop the now unused 'use C4::Biblio qw( GetAuthorisedValueDesc )' - No functional changes, the resolved descriptions are the same Test plan: 1. Have OPACShelfBrowser, ShelfBrowserUsesHomeBranch, ShelfBrowserUsesLocation and ShelfBrowserUsesCcode enabled 2. Open the OPAC detail page for an item and open the shelf browser 3. Notice the starting homebranch, location and ccode descriptions are shown correctly, as before 4. Run: $ ktd --shell k$ prove t/db_dependent/ShelfBrowser.t => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed CC| |david@davidnind.com --- Comment #14 from David Nind <david@davidnind.com> --- Everything looks OK to me and things work as expected, although having another sign off could be useful. Testing notes (using KTD): 1. Set OpacHiddenItems: withdrawn: [1] 2. Search for perl 3. Add some call numbers (o - Full call number) as follows to all the items for Perl records (11 search results) . Programming Perl (262) (1 item): PERL 05 . Perl best practices (5) (no items): no items, so won't show up in shelf browser) . Programming the Perl DBI (13) (1 item): PERL 10 . The definitive guide to Catalyst (146) (4 items): PERL 20 . Perl Better Practices (191) (1 item): PERL 30 . CGI programming with Perl (11) (1 item): PERL 40 . Intermediate Perl (126) (4 items): PERL 50 . Effective Perl programming (139) (2 items): PERL 60 . Higher-order Perl (165) (1 item)): PERL 70 . Perl template toolkit (255) (4 items): PERL 80 . Perl Hacks (115) (3 items): PERL 90 4. Make some items withdrawn (set 0 - Withdrawn status to Withdrawn): . Programming Perl (262) (PERL 05): 39999000011418 (only 1 item, so record should not be shown) . The definitive guide to Catalyst (146) (PERL 20): 39999000006117 (4 items, so record should still show) . Higher-order Perl (165) (PERL 70): 39999000007077 (only 1 item, so record should not be shown) 5. Mark some records as suppressed (edit record, set 942$n = Yes): . Perl template toolkit (255) (4 items) (PERL 80) . Perl Hacks (115) (3 items) (PERL 90) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17921 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |aleisha@catalyst.net.nz |y.org | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org