[Koha-bugs] [Bug 7073] New: GetCOinSBiblio should take $record, not $biblionumber

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Oct 20 21:48:33 CEST 2011


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

             Bug #: 7073
           Summary: GetCOinSBiblio should take $record, not $biblionumber
    Classification: Unclassified
 Change sponsored?: ---
           Product: Koha
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: Architecture, internals, and plumbing
        AssignedTo: ian.walls at bywatersolutions.com
        ReportedBy: ian.walls at bywatersolutions.com
         QAContact: koha-bugs at lists.koha-community.org


GetCOinSBiblio is summoned three places in Koha so far: 
C4::VirtualShelves/Page.pm, opac/opac-search.pl and opac/opac-detail.pl.  It
takes in a biblionumber, then immediately calls GetMarcBiblio on that to get
the record.  This is a very expensive call.

The kicker is that in 2 of the 3 contexts, we've ALREADY GOT the $record. 
We're pulling it in twice per title, and the number of titles we loop through
is either OPACnumsearchresults or numsearchresults.  The default of 20 has us
making 40 calls to GetMarcBiblio... at several dozen milliseconds per call,
that's a lot of time!

If we change the GetCOinSBbiblio routine to take in a $record object instead,
we save those calls on Lists and opac/opac-detail.pl.  We'd just need to call
GetMarcBiblio in the search results before calling GetCOinSBiblio... which is
just moving the call from inside the subroutine to outside (no performance
loss).

Patch forthcoming.

-- 
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