[Bug 19704] New: OPACs most popular feature is displaying links to items set to be hidden in the opachiddenitems syspref which gives 404 errors when links are clicked
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 Bug ID: 19704 Summary: OPACs most popular feature is displaying links to items set to be hidden in the opachiddenitems syspref which gives 404 errors when links are clicked Change sponsored?: --- Product: Koha Version: 17.05 Hardware: All OS: All Status: NEW Severity: normal Priority: P3 Component: OPAC Assignee: oleonard@myacpl.org Reporter: alexbuckley@catalyst.net.nz QA Contact: testopia@bugs.koha-community.org When a library item has multiple bibliographic records and associated items with differing item types (e.g. fiction and express fiction and non-fiction) the Most popular feature is displaying links to items which are set to be hidden in the opachiddenitems syspref. When the user clicks on the link to these items a 404 error is displayed to the user. Therefore the most popular feature is incorrectly displaying links to hidden items. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|17.05 |master CC| |katrin.fischer@bsz-bw.de Summary|OPACs most popular feature |OPACs most popular feature |is displaying links to |includes titles hidden by |items set to be hidden in |OpacHiddenItems |the opachiddenitems syspref | |which gives 404 errors when | |links are clicked | 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 watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 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=19704 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- 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. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #1 from David Cook <dcook@prosentient.com.au> --- *** Bug 20662 has been marked as a duplicate of this bug. *** -- 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=19704 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- Still an issue in master -- 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=19704 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- It should also take into account OpacSuppression -- 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=19704 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- "OpacHiddenItems" is such a pain... I was thinking that it's too bad that we don't just save a "hidden" status when items are saved, but then I remembered that you can update "OpacHiddenItems" at any time, and that can dramatically change which records are hidden, and it would be expensive to re-calculate a stored state for every record as a result... But with C4::Circulation::GetTopIssues, we need to process every record fetched to see if it's hidden... I suppose we could fetch $count and if X records are hidden then we need to fetch at least X new records (based off the $count offset) to try to fill in the gaps. It wouldn't be very efficient but it might be the only way of working with the current "hidden" model... -- 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=19704 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- Technically, using multiple queries could also mean we could run into a race condition but I can't think of any other way of doing it. -- 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=19704 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #5)
Technically, using multiple queries could also mean we could run into a race condition but I can't think of any other way of doing it.
Actually, one safeguard against that would be to initially pre-fetch X records more than we need I suppose... -- 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=19704 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- Actually... I have another idea... https://wiki.koha-community.org/wiki/OpacHiddenItems We could read that YAML into a Perl hash and then create a DBIC query or use SQL::Abstract... -- 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=19704 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- Of course, that wouldn't take into account "OpacSuppression" which isn't stored anywhere except the MARCXML. Maybe a database column would make sense for "OpacSuppression"... -- 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=19704 --- Comment #9 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #7)
Actually... I have another idea...
https://wiki.koha-community.org/wiki/OpacHiddenItems
We could read that YAML into a Perl hash and then create a DBIC query or use SQL::Abstract...
Ah the syspref "OpacHiddenItemsExceptions" exists... that makes it even more fun. -- 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=19704 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18989 -- 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=19704 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=19704 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- Created attachment 136433 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136433&action=edit Bug 17904: Make OPAC "Most popular" respect hidden record sysprefs At the moment, OpacSuppression and OpacHiddenItems don't affect the output of the OPAC's "Most popular" page. This patch adds support for the OpacSuppression and OpacHiddenItems system preferences, so that items are excluded from the "Most popular" calculation based on the hidden rules. Test plan: 0a. Apply patches 0b. koha-plack --restart kohadev 0c. Log into Koha as "koha" user 1. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacTopissue 2. Enable "OpacTopissue" 3. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51 4. Checkout 39999000001310 5. Checkout 39999000005578 6. Checkout 39999000004571 7. Checkout 39999000005592 8. Go to http://localhost:8080/cgi-bin/koha/opac-topissues.pl?limit=10&branch=&itemtype=&timeLimit=999&do_it=1 9. See 3 titles 10. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacHiddenItems 11. Change "OpacHiddenItems" to the following (within the single quotes): barcode: [39999000001310,39999000005578] location: ['RANDOM','THAT','THIS'] 12. Go to http://localhost:8080/cgi-bin/koha/opac-topissues.pl?limit=10&branch=&itemtype=&timeLimit=999&do_it=1 13. See 2 titles ("Gairm" is hidden, as is one of the items for "Continuous delivery /") 14. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacHiddenItemsExceptions 15. Update the syspref to 'S' 16. Go to http://localhost:8080/cgi-bin/koha/opac-topissues.pl?limit=10&branch=&itemtype=&timeLimit=999&do_it=1 17. See 3 titles again 18. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacSuppression 19. Change syspref to "Hide" 20. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=114 21. Change 942$n to "Yes" and save record 22. Go to http://localhost:8080/cgi-bin/koha/opac-topissues.pl?limit=10&branch=&itemtype=&timeLimit=999&do_it=1 23. See 2 titles ("Clean code : a handbook of agile software craftsmanship / Robert C. Martin ... [et al.]" is suppressed -- 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=19704 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136433|0 |1 is obsolete| | --- Comment #11 from David Cook <dcook@prosentient.com.au> --- Created attachment 136434 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136434&action=edit Bug 19704: Make OPAC "Most popular" respect hidden record sysprefs At the moment, OpacSuppression and OpacHiddenItems don't affect the output of the OPAC's "Most popular" page. This patch adds support for the OpacSuppression and OpacHiddenItems system preferences, so that items are excluded from the "Most popular" calculation based on the hidden rules. Test plan: 0a. Apply patches 0b. koha-plack --restart kohadev 0c. Log into Koha as "koha" user 1. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacTopissue 2. Enable "OpacTopissue" 3. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51 4. Checkout 39999000001310 5. Checkout 39999000005578 6. Checkout 39999000004571 7. Checkout 39999000005592 8. Go to http://localhost:8080/cgi-bin/koha/opac-topissues.pl?limit=10&branch=&itemtype=&timeLimit=999&do_it=1 9. See 3 titles 10. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacHiddenItems 11. Change "OpacHiddenItems" to the following (within the single quotes): barcode: [39999000001310,39999000005578] location: ['RANDOM','THAT','THIS'] 12. Go to http://localhost:8080/cgi-bin/koha/opac-topissues.pl?limit=10&branch=&itemtype=&timeLimit=999&do_it=1 13. See 2 titles ("Gairm" is hidden, as is one of the items for "Continuous delivery /") 14. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacHiddenItemsExceptions 15. Update the syspref to 'S' 16. Go to http://localhost:8080/cgi-bin/koha/opac-topissues.pl?limit=10&branch=&itemtype=&timeLimit=999&do_it=1 17. See 3 titles again 18. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacSuppression 19. Change syspref to "Hide" 20. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=114 21. Change 942$n to "Yes" and save record 22. Go to http://localhost:8080/cgi-bin/koha/opac-topissues.pl?limit=10&branch=&itemtype=&timeLimit=999&do_it=1 23. See 2 titles ("Clean code : a handbook of agile software craftsmanship / Robert C. Martin ... [et al.]" is suppressed) -- 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=19704 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | -- 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=19704 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=19704 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136434|0 |1 is obsolete| | --- Comment #12 from David Nind <david@davidnind.com> --- Created attachment 137273 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137273&action=edit Bug 19704: Make OPAC "Most popular" respect hidden record sysprefs At the moment, OpacSuppression and OpacHiddenItems don't affect the output of the OPAC's "Most popular" page. This patch adds support for the OpacSuppression and OpacHiddenItems system preferences, so that items are excluded from the "Most popular" calculation based on the hidden rules. Test plan: 0a. Apply patches 0b. koha-plack --restart kohadev 0c. Log into Koha as "koha" user 1. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacTopissue 2. Enable "OpacTopissue" 3. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51 4. Checkout 39999000001310 5. Checkout 39999000005578 6. Checkout 39999000004571 7. Checkout 39999000005592 8. Go to http://localhost:8080/cgi-bin/koha/opac-topissues.pl?limit=10&branch=&itemtype=&timeLimit=999&do_it=1 9. See 3 titles 10. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacHiddenItems 11. Change "OpacHiddenItems" to the following (within the single quotes): barcode: [39999000001310,39999000005578] location: ['RANDOM','THAT','THIS'] 12. Go to http://localhost:8080/cgi-bin/koha/opac-topissues.pl?limit=10&branch=&itemtype=&timeLimit=999&do_it=1 13. See 2 titles ("Gairm" is hidden, as is one of the items for "Continuous delivery /") 14. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacHiddenItemsExceptions 15. Update the syspref to 'S' 16. Go to http://localhost:8080/cgi-bin/koha/opac-topissues.pl?limit=10&branch=&itemtype=&timeLimit=999&do_it=1 17. See 3 titles again 18. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacSuppression 19. Change syspref to "Hide" 20. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=114 21. Change 942$n to "Yes" and save record 22. Go to http://localhost:8080/cgi-bin/koha/opac-topissues.pl?limit=10&branch=&itemtype=&timeLimit=999&do_it=1 23. See 2 titles ("Clean code : a handbook of agile software craftsmanship / Robert C. Martin ... [et al.]" is suppressed) 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=19704 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes the "Most release notes| |popular" list in the OPAC | |(enabled using the | |OpacTopissue system | |preference) so that items | |are correctly excluded when | |the OpacSuppression and | |OpacHiddenItems system | |preferences are configured. | |Before this, settings for | |these two system | |preferences had no effect | |on the "Most popular" page. CC| |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=19704 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Quite keen to see this one fixed, but we have 2 complaints in the QA test tools. Can you please fix? FAIL C4/Circulation.pm FAIL critic # Variables::ProhibitConditionalDeclarations: Got 2 violation(s). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 --- Comment #14 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #13)
Quite keen to see this one fixed, but we have 2 complaints in the QA test tools. Can you please fix?
FAIL C4/Circulation.pm FAIL critic # Variables::ProhibitConditionalDeclarations: Got 2 violation(s).
I saw your message, and it's on my TODO list. I'll be coming back to this! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 --- Comment #15 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #14)
(In reply to Katrin Fischer from comment #13)
Quite keen to see this one fixed, but we have 2 complaints in the QA test tools. Can you please fix?
FAIL C4/Circulation.pm FAIL critic # Variables::ProhibitConditionalDeclarations: Got 2 violation(s).
I saw your message, and it's on my TODO list. I'll be coming back to this!
My ever growing TODO list, unfortunately... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31161 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Ping? :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 --- Comment #17 from David Cook <dcook@prosentient.com.au> --- I think I need to refactor this one. Need to move the code into a separate module and add unit tests for it. The Hidden and Suppression fields need more methods built up around them... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 --- Comment #18 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #17)
I think I need to refactor this one.
Need to move the code into a separate module and add unit tests for it.
Although that's hard to do because it needs to produce SQL specific to the GetTopIssues function in C4::Circulation... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=11690 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nengard@gmail.com --- Comment #19 from David Cook <dcook@prosentient.com.au> --- *** Bug 11690 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 --- Comment #20 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Would be great to see this one revived. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 --- Comment #21 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #20)
Would be great to see this one revived.
It's pretty low on my list at the moment, so I probably won't be looking at it until early to mid 2024 I think. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|katrin.fischer@bsz-bw.de |testopia@bugs.koha-communit | |y.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19704 --- Comment #22 from David Cook <dcook@prosentient.com.au> --- I'll have to look at this one again... -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org