https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44284 --- Comment #10 from babar junaid <babarjunaid1122@gmail.com> --- Created attachment 212598 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212598&action=edit Bug 44284: Use ViewPolicy to hide subfields in the staff MARC view Bug 44284: Use ViewPolicy to hide subfields in the staff MARC view MARCdetail.pl loaded the record without an interface, so the ViewPolicy filter was not applied, and it hid subfields itself with an unanchored regular expression. -5 (OPAC, Intranet and Collapsed checked) matched "5" and the subfield was hidden in the staff interface. The record is now loaded with interface => 'intranet', as ISBDdetail.pl already does, and the three regular expression checks are removed. ViewPolicy's staff list (-8, -7, -4, -3, -2, 2, 3, 5, 8) decides what is hidden, for control fields, data fields and embedded item fields. The MARC view can be shown with another framework (the "With framework" menu, ?frameworkcode=). So that the chosen framework's visibility is still used, metadata_record gets an optional frameworkcode parameter, defaulting to the record's own framework. Test plan: 1. Administration > MARC bibliographic framework: - BKS > 245 > subfield b: check OPAC, Intranet and Collapsed, uncheck Editor (hidden = -5) - BKS > 245 > subfield c: uncheck Intranet (hidden = 5) - Default > 245 > subfield b: uncheck Intranet (hidden = 5) 2. Open the MARC tab of biblionumber 1 (BKS) in the sample data: 245$b and 245$c are both missing. 3. Apply the patches, restart Plack, reload: - 245$b is shown, 245$c is not 4. Pick Default in the "With framework" menu: 245$b is hidden, 245$c is shown. 5. prove t/db_dependent/Koha/Biblio.t t/db_dependent/Filter_MARC_ViewPolicy.t 6. Set the subfields back to their old settings. Sponsored-by: Koha Solutions -- You are receiving this mail because: You are watching all bug changes.