[Koha-bugs] [Bug 6600] Library name linking wrong if current location is different

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Sep 1 18:29:32 CEST 2011


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

Ian Walls <ian.walls at bywatersolutions.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ian.walls at bywatersolutions.
                   |                            |com

--- Comment #2 from Ian Walls <ian.walls at bywatersolutions.com> 2011-09-01 16:29:32 UTC ---
I'm extremely leery about making a change in a major C4 subroutine to fix such
a minor display issue, but in all likelihood, it's *probably* safe, since the
only information being pulled in from the branches table is branchurl.

However, I think a further improvement can be made.  The query only selects
branchurl, none of the other branch information.  Later in the subroutine,
another query is done EACH ITEM RETURNED by the query (which is all the items
for the biblio).  Here's the code:

        #get branch information.....
        my $bsth = $dbh->prepare(
            "SELECT * FROM branches WHERE branchcode = ?
        "
        );
        $bsth->execute( $data->{'holdingbranch'} );
        if ( my $bdata = $bsth->fetchrow_hashref ) {
            $data->{'branchname'} = $bdata->{'branchname'};
        }

This is using holdingbranch, which explains why the branchname is indeed the
holdingbranch.

Improvement:  Remove this extra check altogether, and just pull in the
branchname from the original query, along side branchurl.  This will reduce the
number of queries MySQL must perform, improving (however marginally) the
performance of this subroutine.  Since it's a major workhorse of a subroutine
(called many time all over the codebase), the net effect could be substantial.

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