[Bug 40481] New: The items table on koha/opac-MARCdetail.pl does not honor OPACHiddenItems
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 Bug ID: 40481 Summary: The items table on koha/opac-MARCdetail.pl does not honor OPACHiddenItems Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org 1. Set OPACHiddenItems to hide lost items: itemlost: [1] 2. Find a record with a lost item. 3. In the OPAC, go to the MARC view and scroll to the bottom. 4. The lost item is displaying. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=40481 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 188582 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188582&action=edit Bug 40841: DB changes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 --- Comment #2 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 188583 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188583&action=edit Bug 40841: Add Z39.50 library limits This patch adds the library limits mixin to the Z39.50 classes following a well established pattern in Koha. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 --- Comment #3 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 188584 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188584&action=edit Bug 40841: DBIC schema [DO NOT PUSH] Patch from commit 56ac99b -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 --- Comment #4 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 188585 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188585&action=edit Bug 40841: Add limits configuration UI This patch adds branch limits selection to the Z30.50/SRU configuration page. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 --- Comment #5 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 188586 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188586&action=edit Bug 40841: Implement library limits on Z39.50 searches This patchset implements Z39.50/SRU limits by branch in Koha. Key implementation notes: - Follows Koha's established pattern for library limits - A new table linking to library limits is added - The admin UI is adjusted so the form includes library limit selection - Z39.50/SRU search controllers use the `search_with_library_limits` methods to correctly constraint the offered servers. To test: 1. Apply this patches 2. Run: $ ktd --shell k$ updatedatabase => SUCCESS: Database upgrade goes well 3. Re-run: k$ updatedatabase => SUCCESS: No explosions, DB update idempotent 4. Restart everything: k$ restart_all 5. POint your browser to the admin page: http://kohadev-intra.localhost/cgi-bin/koha/admin/z3950servers.pl => SUCCESS: A new column is displayed for library limits brief 6. Edit `LIBRARY OF CONGRESS` => SUCCESS: The form includes the usual library limit selection UI 7. Choose some branches, excluding your current one (KTD's default is 'Centerville'). 8. Save => SUCCESS: It is saved correctly => SUCCESS: The table shows the edited library has the library limits set 9. Edit again => SUCCESS: The selected limits are preserved when editing 10. Pick some authorities Z39.50 target, and exclude your current branch for testing purposes. 11. Go to Cataloguing, and choose 'New from Z39.50/SRU' => SUCCESS: Limits are respected! 12. Go to Authorities, and choose 'New from Z39.50/SRU' => SUCCESS: Limits are respected! 13. 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=40481 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Medium patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188582|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=40481 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188583|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=40481 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188584|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=40481 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188585|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=40481 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188586|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=40481 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 --- Comment #6 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 194401 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194401&action=edit Bug 40841: Add limits configuration UI This patch adds branch limits selection to the Z30.50/SRU configuration page. Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> 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=40481 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194401|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=40481 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Status|Needs Signoff |ASSIGNED --- Comment #7 from David Nind <david@davidnind.com> --- Changed status from needs signoff back to assigned. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |CONFIRMED --- Comment #8 from David Nind <david@davidnind.com> --- Can confirm that this is happening, changed to CONFIRMED. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #9 from David Cook <dcook@prosentient.com.au> --- Mmm fun times... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|CONFIRMED |ASSIGNED --- Comment #10 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Hi, I didn't know about this bug and really attached patches for a pretty similar bug number here by a typo in my terminal. That said. This is an easy fix and I'll just do it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|Medium patch |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 --- Comment #11 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 194446 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194446&action=edit Bug 40481: Fix OPAC MARC detail showing hidden items The OPAC MARC detail view (opac-MARCdetail.pl) uses $record->fields() to build the items table. This pulls item fields from the embedded MARC record, bypassing the OPACHiddenItems filtering done by filter_by_visible_in_opac. This patch replaces the $record->fields() call with the already-filtered $items resultset, converting each Koha::Item back to a MARC::Field via as_marc_field. Test plan: 1. Apply patch, do not restart plack yet 2. Setup: $ ktd --shell k$ koha-mysql kohadev <<< "UPDATE systempreferences SET value = 'damaged: [1]' WHERE variable = 'OpacHiddenItems';" k$ koha-mysql kohadev <<< "UPDATE items SET damaged = 1 WHERE biblionumber = 416 LIMIT 1;" k$ flush_memcached 3. Point your browser to the OPAC MARC detail view: http://kohadev.localhost/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=416 => FAIL: The damaged item is displayed in the items table 4. Restart plack: k$ restart_all 5. Refresh the page => SUCCESS: The damaged item is no longer displayed 6. Undo the test data: k$ koha-mysql kohadev <<< "UPDATE items SET damaged = 0 WHERE biblionumber = 416;" k$ koha-mysql kohadev <<< "UPDATE systempreferences SET value = '' WHERE variable = 'OpacHiddenItems';" k$ flush_memcached 7. 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=40481 --- Comment #12 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 194447 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194447&action=edit Bug 40481: (follow-up) Simplify item loop in OPAC MARC detail Now that the item loop only processes item fields from the filtered $items resultset, several checks and patterns become unnecessary. Changes: - Remove dead checks: tag < 10 and tab != 10 guards - Resolve $tagslib->{$item_tag} once instead of per-subfield - Destructure ($code, $value) instead of indexed $subf[$i][0/1] - Replace per-subfield grep over date kohafields with a hash lookup - Remove redundant second $tagslib lookup for $kohafield - Collapse repeatable if/else into a ternary No functional changes. Test plan: 1. Apply patch 2. Run the same test plan as the previous patch => SUCCESS: Behavior is identical 3. 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=40481 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=40481 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194446|0 |1 is obsolete| | --- Comment #13 from David Nind <david@davidnind.com> --- Created attachment 194451 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194451&action=edit Bug 40481: Fix OPAC MARC detail showing hidden items The OPAC MARC detail view (opac-MARCdetail.pl) uses $record->fields() to build the items table. This pulls item fields from the embedded MARC record, bypassing the OPACHiddenItems filtering done by filter_by_visible_in_opac. This patch replaces the $record->fields() call with the already-filtered $items resultset, converting each Koha::Item back to a MARC::Field via as_marc_field. Test plan: 1. Apply patch, do not restart plack yet 2. Setup: $ ktd --shell k$ koha-mysql kohadev <<< "UPDATE systempreferences SET value = 'damaged: [1]' WHERE variable = 'OpacHiddenItems';" k$ koha-mysql kohadev <<< "UPDATE items SET damaged = 1 WHERE biblionumber = 416 LIMIT 1;" k$ flush_memcached 3. Point your browser to the OPAC MARC detail view: http://kohadev.localhost/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=416 => FAIL: The damaged item is displayed in the items table 4. Restart plack: k$ restart_all 5. Refresh the page => SUCCESS: The damaged item is no longer displayed 6. Undo the test data: k$ koha-mysql kohadev <<< "UPDATE items SET damaged = 0 WHERE biblionumber = 416;" k$ koha-mysql kohadev <<< "UPDATE systempreferences SET value = '' WHERE variable = 'OpacHiddenItems';" k$ flush_memcached 7. 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=40481 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194447|0 |1 is obsolete| | --- Comment #14 from David Nind <david@davidnind.com> --- Created attachment 194452 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194452&action=edit Bug 40481: (follow-up) Simplify item loop in OPAC MARC detail Now that the item loop only processes item fields from the filtered $items resultset, several checks and patterns become unnecessary. Changes: - Remove dead checks: tag < 10 and tab != 10 guards - Resolve $tagslib->{$item_tag} once instead of per-subfield - Destructure ($code, $value) instead of indexed $subf[$i][0/1] - Replace per-subfield grep over date kohafields with a hash lookup - Remove redundant second $tagslib lookup for $kohafield - Collapse repeatable if/else into a ternary No functional changes. Test plan: 1. Apply patch 2. Run the same test plan as the previous patch => SUCCESS: Behavior is identical 3. 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=40481 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes the MARC view in release notes| |the OPAC where an item | |should be hidden when | |OPACHiddenItems rules | |should apply. The item was | |hidden in the normal view, | |but not in the MARC view. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |dcook@prosentient.com.au |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194451|0 |1 is obsolete| | --- Comment #15 from David Cook <dcook@prosentient.com.au> --- Created attachment 195607 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195607&action=edit Bug 40481: Fix OPAC MARC detail showing hidden items The OPAC MARC detail view (opac-MARCdetail.pl) uses $record->fields() to build the items table. This pulls item fields from the embedded MARC record, bypassing the OPACHiddenItems filtering done by filter_by_visible_in_opac. This patch replaces the $record->fields() call with the already-filtered $items resultset, converting each Koha::Item back to a MARC::Field via as_marc_field. Test plan: 1. Apply patch, do not restart plack yet 2. Setup: $ ktd --shell k$ koha-mysql kohadev <<< "UPDATE systempreferences SET value = 'damaged: [1]' WHERE variable = 'OpacHiddenItems';" k$ koha-mysql kohadev <<< "UPDATE items SET damaged = 1 WHERE biblionumber = 416 LIMIT 1;" k$ flush_memcached 3. Point your browser to the OPAC MARC detail view: http://kohadev.localhost/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=416 => FAIL: The damaged item is displayed in the items table 4. Restart plack: k$ restart_all 5. Refresh the page => SUCCESS: The damaged item is no longer displayed 6. Undo the test data: k$ koha-mysql kohadev <<< "UPDATE items SET damaged = 0 WHERE biblionumber = 416;" k$ koha-mysql kohadev <<< "UPDATE systempreferences SET value = '' WHERE variable = 'OpacHiddenItems';" k$ flush_memcached 7. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Cook <dcook@prosentient.com.au> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194452|0 |1 is obsolete| | --- Comment #16 from David Cook <dcook@prosentient.com.au> --- Created attachment 195608 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195608&action=edit Bug 40481: (follow-up) Simplify item loop in OPAC MARC detail Now that the item loop only processes item fields from the filtered $items resultset, several checks and patterns become unnecessary. Changes: - Remove dead checks: tag < 10 and tab != 10 guards - Resolve $tagslib->{$item_tag} once instead of per-subfield - Destructure ($code, $value) instead of indexed $subf[$i][0/1] - Replace per-subfield grep over date kohafields with a hash lookup - Remove redundant second $tagslib lookup for $kohafield - Collapse repeatable if/else into a ternary No functional changes. Test plan: 1. Apply patch 2. Run the same test plan as the previous patch => SUCCESS: Behavior is identical 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Cook <dcook@prosentient.com.au> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 --- Comment #17 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Thanks for all the hard work! Pushed to main for the next 26.05.00 release as RM Assistant -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|26.05.00 |26.05.00,25.11.05 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40481 --- Comment #18 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org