[Koha-bugs] [Bug 5842] New: Cross-Reference links to authorized fields give incomplete search results

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Mar 8 17:41:55 CET 2011


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

             Bug #: 5842
           Summary: Cross-Reference links to authorized fields give
                    incomplete search results
    Classification: Unclassified
 Change sponsored?: ---
           Product: Koha
           Version: rel_3_4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Searching
        AssignedTo: gmcharlt at gmail.com
        ReportedBy: jwagner at ptfs.com
         QAContact: koha-bugs at lists.koha-community.org


The end-result problem is that clicking on cross-reference links in OPAC or
staff XSLT title displays (authors, subjects) can produce incomplete results. 
The underlying problem is fairly complex.  (Kudos to Bev Church for doing a lot
of the in-depth research.)

At the moment, there is only one system preference that controls authority
creation -- BiblioAddsAuthorities.

If you set the preference to OFF, staff cannot enter data in any authority
controlled subfield.

o    Staff must first create an authority record and then link it to the
bibliographic record if they manually create a bibliographic record. This is
not a viable option for a lot of sites; they do not want to work with authority
records or don't have the knowledge to create and then link a record.

o    Koha does no automatic bib/authority linking or authority creation if
bibliographic records are imported using Z39.50 and the MARC import tool.



If you set the preference to ON, staff can enter data in any authority
controlled subfield.

o    Koha does automatic bib/authority linking and authority creation if
bibliographic records are manually added or imported using Z39.50.

o    Koha does NO automatic bib/authority linking and authority creation if
bibliographic records are added using the MARC import tool.



With BiblioAddsAuthorities on, if a site does batch imports, the end result is
that some authority controlled tags in their bibliographic records are linked
to authority records while others are not. This affects the way Koha retrieves
titles when users/staff click on the authority links in the full bibliographic
record due to a searching enhancement. 

As it stands, the XSLT for both staff and OPAC checks for any authority record
number in subfield $9 of authority controlled tags (the various author and
subject fields) in the bibliographic record. If one exists, Koha uses the
authority number as the search parameter instead of the name/subject string
itself.  For example, in an OPAC XSLT title record display, clicking on the
author or one of the subjects will search against the titles linked to the
authority record, not the equivalent author or subject zebra index.  The search
results may not be complete -- there are most probably fewer hits than if the
search was done as a zebra title or subject search.

See the following difference in how those cross-reference search links are
formed with and without the link to the authority record:

http://myserver/cgi-bin/koha/opac-search.pl?q=an:37
http://myserver/cgi-bin/koha/opac-search.pl?q=au:Carroll,%20Jonathan,



http://myserver/cgi-bin/koha/opac-search.pl?q=an:38
http://myserver/cgi-bin/koha/opac-search.pl?q=su:Children%27s%20stories


The most complete fix would be to modify the batch import tool to create the
brief authority records, and do some substantial work on linking and merging
authority records.

I don't have the skill to do that, but I came up with a partial
lipstick-on-a-pig solution.  I created a system preference called
CrossRefsUseAuthorities with this description:

"If on, author and subject cross-references from title displays will use
authority record to find related titles in staff and OPAC XSLT title display.
If off, forces author and subject cross-reference searches to use the zebra
indexes rather than the authority indexes; needed when BiblioAddsAuthorities is
on but not all records have authorities (or there are multiple authority
records). In that situation, a cross-reference search on the authority entry
will not retrieve all titles."

This tested and worked OK for OPAC XSLT, but I could not make it work for staff
XSLT.  The problem there seems to be that the part of C4/XSLT.pm which passes
variables to the XSLT stylesheet is not being obeyed:

    foreach my $syspref ( qw/OPACURLOpenInNewWindow DisplayOPACiconsXSLT
URLLinkText viewISBD OPACBaseURL CrossRefsUseAuthorities/ ) {

Therefore, when I tried to modify the staff XSLT files similar to the change I
did in the OPAC XSLT files:

        <xsl:choose>
            <xsl:when test="marc:subfield[@code=9] and
$CrossRefsUseAuthorities!='0'">
                <xsl:attribute
name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of
select="marc:subfield[@code=9]"/></xsl:attribute>
            </xsl:when>
            <xsl:otherwise>
            <xsl:attribute
name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of
select="marc:subfield[@code='a']"/></xsl:attribute>
            </xsl:otherwise>
        </xsl:choose>



I got error messages about invalid variables from trying to use the system
preference.

I don't know how to fix that problem.  I am attaching a patch file for the part
that I do have working (the syspref and the OPAC XSLT files).  Can someone test
those?  Any takers to (a) solve the staff XSLT problem and/or (b) solve the
underlying problem of authorities not being created with imports?

-- 
Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.


More information about the Koha-bugs mailing list