[Koha-bugs] [Bug 30825] Get rid of GetReservesControlBranch

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon May 23 17:10:11 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30825

--- Comment #10 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
On second look this is more involved to demonstrate than I thought...

We have:

$patron ||= Koha::Patron->find($patron_id);
$item->holds_control_library;

Which could plausibly be

$item->holds_control_library({ patron_id => $patron_id, patron =>$patron });

That would mean that if we didn't need the $patron object in the
holds_control_library call there we could save ourselves a Koha::Patron->find
call.

However, I then spotted that we do refer to $patron again lower down the
containing method.. but again, inside a syspref controlled statement.. so we
still might not need it.

That lead me to believe that a good structure would be to pass around
references.. then upon the first time we actually need the patron object we do
the fetch and populate the reference.. there onwards we have a populated ref we
can refer to in other calls.

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


More information about the Koha-bugs mailing list