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.