[Koha-bugs] [Bug 11592] opac scripts do not respect MARC tag visibility

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed May 7 05:48:13 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592

M. Tompsett <mtompset at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #24953|0                           |1
        is obsolete|                            |

--- Comment #31 from M. Tompsett <mtompset at hotmail.com> ---
Created attachment 28003
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28003&action=edit
Bug 11592 - opac scripts do not respect marc tag visibility

Added two functions to C4/Biblio: GetFilteredOpacBiblio
and GetOpacHideMARC.

GetFilteredOpacBiblio returns a MARC::Record stripped of all the
fields and subfields which are supposed to be hidden in OPAC.

GetOpacHideMARC returns a hash of whether a particular key
(eg. title, subtitle, etc.)  is hidden. A value of 0 means no,
a value of 1 means hidden.

Made GetCOinSBiblio function handle hiding of 245$a more
gracefully. Also, modified GetMarcSubjects to not generate an
array entry of empty values.

Tweaked C4/XSLT.pm to delete a field, if there weren't any
subfields to actually update with.

Properly hid 245$a, in the case that there is no visibility
for OPAC, for opac-MARCdetail.

opac-detail now filters the MARC::Record according to the hidden
value in marc_subfield_structure properly. It also corrects a
couple minor issues with a parameter not passed being used in a
concatenation. How the subtitle values calculation works changed.
It is now based on marc_subfield_structure and not fieldmapping.
And, the GetBiblioData hash that generates template variables is
now filtered by the results of a GetOpacHideMARC call.

The opac-showmarc page now converts the MARCXML record to a
MARC::Record to easily filter using GetFilteredOpacBiblio, which
is then turned back into MARCXML for processing.

The opac-export script now filters the biblio record to match
what is currently displayed.

Added tests to t/db_dependent/Biblio.t to test the functionality
of the two functions added into C4::Biblio.

Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so
that it should be filtered.

TEST PLAN
---------
 1) Backup DB
 2) Go to any OPAC detail page and note the biblio number.
 3) Log into the staff client and determine the framework code for
     that biblio number.
 4) The steps should be done with OPACXSLTDetailsDisplay
     set to blank.
 5) Home -> Koha administration -> MARC bibliographic framework
         -> MARC structure (for the matching framework)
 6) On the OPAC detail page, click MARC view
 7) In the staff client, for every tag listed in the OPAC
     -> Subfields -> click the first link
     Then running through all the tabs, click Advanced constraints
      and uncheck OPAC visibility. Then click Save Changes
 8) Refresh the opac-MARCdetail page in OPAC
    -- what you hid should be mostly hidden
       TITLE will still display, even if you hide 245$a!
 9) Click Normal view, and all the hidden things are still
     mostly showing!
10) The steps should be done with OPACXSLTDetailsDisplay
    set to default (or some custom one?).
11) Refresh the opac-detail page. Still mostly showing all the
     hidden things.
12) Click MARC view, and everything should be hidden...
13) Until you click the 'view plain' link.
14) Apply the patch.
15) Run the Koha QA test tool.
16) Refresh the opac-MARCdetail page. Title should hide now.
17) Click the 'view plain' link.
    -- LDR and 999$c and 999$d were displaying for me.
       I realized that I hadn't hidden 999, because the
       opac-MARCdetail page doesn't display it.
       LDR is the only known leak.
18) Click Normal view
19) Now all the opac-detail page should hide things just like
     the opac-MARCdetail page.
20) In the staff client, change the OPACXSLTDetailsDisplay to
     a blank value.
21) Recheck opac-detail and opac-MARC detail pages again,
     including the view plain link, and everything should
     hidden similarly.
    -- NOTE: LDR is the only known leak.
NOTE: 952 fields are treated separately, so I don't believe they
      could be hidden in the table using the MARC visibility.
      The goal was hiding properly things above the items.
22) And lastly, attempt to Save record in the various formats
     using the dropdown and clicking Go.
    -- The results should be filtered.
23) Click on ISBD view to ensure nothing broke.
24) Restore DB, because hiding 000,003,005,008,020,040,245,etc.
    are not useful across an entire framework.

Signed-off-by: Robin Sheat <robin at catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list