[Koha-bugs] [Bug 9367] Code optimization: CheckReserves is too often called

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Mar 11 11:45:47 CET 2013


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

--- Comment #8 from M. de Rooy <m.de.rooy at rijksmuseum.nl> ---
This should work including testing uninitialized:

    if ( $itemnumber ) {
        $sth = $dbh->prepare("SELECT found, priority FROM reserves WHERE
itemnumber = ? order by priority LIMIT 1");
        $sth->execute($itemnumber);
        ($found, $priority) = $sth->fetchrow_array;
    }
    if ( $biblionumber and not defined $found and not defined $priority ) {
        $sth = $dbh->prepare("SELECT found, priority FROM reserves WHERE
biblionumber = ? order by priority LIMIT 1");
        $sth->execute($biblionumber);
       ($found, $priority) = $sth->fetchrow_array;
    }

    return if not defined $found;
etc.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list