Bug 7073: GetCOinSBiblio should take $record object, not biblionumber
authorIan Walls <ian.walls@bywatersolutions.com>
Thu, 20 Oct 2011 19:54:07 +0000 (15:54 -0400)
committerPaul Poulain <paul.poulain@biblibre.com>
Thu, 24 Nov 2011 10:44:02 +0000 (11:44 +0100)
commitf56e6c0a58145ed3a30341bf0df85e17cde0135d
treee9c9f58169a6a13ca748d478667aa391aed39efd
parent2b2e544f054acc5c220dfca035554e2d13b27cdf
Bug 7073: GetCOinSBiblio should take $record object, not biblionumber

This patch changes the GetCOinsBiblio subroutine to take a MARC record object
(as returned from GetMarcBiblio) instead of a biblionumber.  The first thing the subroutine
did was GetMarcBiblio, and the $biblionumber passed was never used again.

This subroutine was only used 3 places: opac/opac-search.pl, opac/opac-detail.pl,
and C4/VirtualShelves/Page.pm.  In the first and last cases, it was used in a loop.
In the last two cases, a call to GetMarcBiblio had already been done.  This is expensive, and
we were doing it twice per record.

For opac/opac-search.pl, the call to GetMarcBiblio was moved to just outside GetCOinSBiblio;
this will not change the performance at all.  But for opac/opac-detail.pl and C4/VirtualShelves/Page.pm,
a redudant call to GetMarcBiblio is now avoided.

To Test:
1. Enable COinSinOPACResults in system preferences.  Perform a search in the OPAC.
   Verify that the COinS spans are showing up
2. View the detail record of one of the returned items.  Confirm that the COinS span exists on the detail page.
3. View a list in the OPAC.  Confirm that COinS spans are still showing up

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
C4/Biblio.pm
C4/VirtualShelves/Page.pm
opac/opac-detail.pl
opac/opac-search.pl