[Koha-bugs] [Bug 21453] New: blinddetail-biblio-search.pl/.tt use hardcoded subfield values for MARC21

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sat Sep 29 09:34:23 CEST 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21453

            Bug ID: 21453
           Summary: blinddetail-biblio-search.pl/.tt use hardcoded
                    subfield values for MARC21
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: MARC Authority data support
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: arouss1980 at gmail.com
        QA Contact: testopia at bugs.koha-community.org

If you add or alter an authority record and edit one of the MARC fields
in UNIMARC 5XX 'See Also Reference Tracing Block' [1], you can click on
the ellipsis (...) next to a subfield [2] to launch the authority finder
plugin. This plugin allows you to search for an authority and then pick
an entry from the 'Special relationship:' dropdown menu in order to set
the relationship between the two authorities.

The results list of the authority finder contains 'Choose' buttons which
_should_ insert all data from the chosen authority into the appropriate
subfields of the MARC tag you are editing [3].

However, in UNIMARC setups this does not work: clicking on 'Choose' only
populates subfield $a ('Entry Element') with data, but not subfields $3
and $5 ('Authority Record Number' and 'Tracing Control', respectively),
which are just as important for correct authority linking.

I've tracked this down to these lines of code which are MARC21-specific
and use hardcoded subfield values in blinddetail-biblio-search.pl:

 91     for ( $field->subfields ) {
 92         next if $_->[0] eq '9'; # $9 will be set with authid value

101     push( @subfield_loop, { marc_subfield => 'w', marc_values =>
$relationship } ) if ( $relationship );

There is also this code in the template blinddetail-biblio-search.tt:

 38                 [%- END -%]‡9[% authid | html %]";

138                     if(code.value=='9'){
139                         subfield.value = "[% authid |replace("'", "\'")
|replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";

These code fragments don't work 100% because in UNIMARC authorities the
authid value is stored in subfield $3 and the relationship code in $5.

I propose to modify the Perl script above (which is currently MARC
flavour agnostic), have it check the 'marcflavour' system preference,
and use that to decide which subfield to push the authority relator
code to. A similar approach in the template file will set the authid
subfield value depending on whether you are a MARC21 or UNIMARC user.

[1] Known as the 'Related Access Point Block' in recent IFLA updates.
[2] For the ellipsis to appear next to a subfield, you must view the
    MARC structure of the relevant authority type and then edit the
    subfields of the tag you're interested in. Finally, you must
    select an authority type from the 'Thesaurus:' dropdown menu.
[3] Under the hood each 'Choose' button is a call to the JS function
    doauth(), which in turn calls blinddetail-biblio-search.pl with
    the parameters required (authid, relationship, etc.).

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


More information about the Koha-bugs mailing list