Summary: | GetCOinSBiblio should take $record, not $biblionumber | ||
---|---|---|---|
Product: | Koha | Reporter: | Ian Walls <koha.sekjal> |
Component: | Architecture, internals, and plumbing | Assignee: | Ian Walls <koha.sekjal> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | enhancement | ||
Priority: | PATCH-Sent (DO NOT USE) | CC: | chris, paul.poulain |
Version: | 3.8 | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Bug Depends on: | |||
Bug Blocks: | 5729 | ||
Attachments: |
Proposed Patch
Bug 7073: GetCOinSBiblio should take $record object, not biblionumber |
Description
Ian Walls
2011-10-20 19:48:33 UTC
Created attachment 6014 [details] [review] Proposed Patch 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 Updating Version : This ENH will be for Koha 3.8 Bug versionned for master. entries will be made against rel_3_8 once the patch has been applied (see thread about that on koha-devel yesterday) Created attachment 6174 [details] [review] 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> Assigning to M. de Rooy for QA QA: Code looks good. Should benefit performance. Well documented. I checked with a grep that there were no other calls to GetCOinSBiblio, that's the case. Patch pushed, please test. There have been no further reports of problems so I am marking this bug resolved. |