https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8331 --- Comment #15 from David Nind <david@davidnind.com> --- Created attachment 212685 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212685&action=edit Bug 8331: Hide subfields hidden in the staff interface in all staff views Subfields whose 'Intranet' visibility is unchecked in the MARC framework were still displayed in the staff normal view (catalogue/detail.pl), the plain MARC view (catalogue/showmarc.pl, all its formats) and the labeled MARC view (catalogue/labeledMARCdetail.pl). Those scripts used the raw record instead of applying Koha::Filter::MARC::ViewPolicy, unlike ISBDdetail.pl and, after bug 44284, MARCdetail.pl. This patch makes them load the record using Koha::Biblio->metadata_record( { interface => 'intranet' } ), so the same filter decides what the staff interface hides: * detail.pl: the filtered record is used for the whole page, as the OPAC detail page already does. * labeledMARCdetail.pl: the framework chosen in the 'With framework' menu is used, as in MARCdetail.pl. * showmarc.pl: the 'card' and 'html' formats now use the (filtered) record instead of re-reading the raw XML with GetXmlBiblio. The full record can still be requested with unfiltered=1, which the merge records page uses, as cataloguers need to see everything they merge. Import records (importid=) are not filtered. A non-existent biblio now gets the 404 page instead of an error. svc/records/preview is intentionally left unfiltered, as batch modification needs to show the full record. Test plan: 1. Apply bug 44284 (this bug depends on it) 2. Administration > MARC bibliographic framework > BKS > 245 > subfield c: uncheck 'Intranet' 3. Open record 1 (BKS) in the staff interface and check: - Normal view - 'Plain MARC' (link on the normal view) - 'Labeled MARC' (in the 'MARC' tab menu) => FAIL: 245$c ('Clinton Heylin.') is displayed in all of them 4. Apply this patch and restart services: $ ktd --shell k$ restart_all 5. Repeat 3 => SUCCESS: 245$c is not displayed in any of them 6. In the labeled MARC view, pick 'Default' in the 'With framework' menu => SUCCESS: 245$c is displayed (not hidden in the Default framework) 7. Go to Cataloging, search for record 1 and another record, select both and choose 'Merge'. Click 'View MARC' for record 1 => SUCCESS: 245$c is displayed (merge shows the full record) 8. Set 245$c back to its original settings 9. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.