[Koha-bugs] [Bug 9011] Add the ability to store the last patron to return an item

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Aug 12 21:50:23 CEST 2015


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

--- Comment #130 from Nick Clemens <nick at quecheelibrary.org> ---
My consortium sponsored this development, and it has taken some time to
progress it this far forward. If MySQL performance is the only blocker right
now I would really like to see a solution that addresses that and unsticks the
bug rather than requiring a rewrite of the feature.

I played around with the query and the below, while still containing a NOT IN,
eliminates the GROUP BY and improves speed significantly:
if ( C4::Context->preference('StoreLastBorrower') ) {
        # Do not delete the newest old_issue for any itemnumber
        $query .= " AND issue_id NOT IN ( SELECT issue_id FROM (Select
oi.issue_id from old_issues oi LEFT OUTER JOIN old_issues oi2 ON
oi.itemnumber=oi2.itemnumber AND oi2.issue_id>oi.issue_id WHERE
oi.borrowernumber= ? AND oi2.borrowernumber IS NULL) AS oi ) ";
        push @bind_params, $borrowernumber;

Another option is to just use the query labeleed as 'oi' above in a separate
update.  It effectively finds all the 'last returned' info for a borrower and
would allow you to mark those somehow (say invert borrower number to negative
of borrowernumber) then perform the regular anonymizing, and then update any
rows with a negative borrowrnumber to a positive borrowernumber (or whatever
marker was used)

I think Chris's comment #129 has been addressed, the feature is optional
(syspref) and gives a big warning to the patron when it is enabled for full
transparency. And I don't think sharing your opinion is overstepping :-) 

If the above queries don't work, a new table could work, though I do wonder
about the redundancy.  I wonder if it would be possible to use the 'return'
column in old_issues to mark 'lastreturned' or something similar to allow for
easy SQL selection.

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


More information about the Koha-bugs mailing list