Bug 27834 - CircControl syspref is used wrong in TooMany function C4::Circulation
Summary: CircControl syspref is used wrong in TooMany function C4::Circulation
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal with 10 votes (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
: 21045 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-03-02 14:06 UTC by Joonas Kylmälä
Modified: 2023-06-06 14:49 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joonas Kylmälä 2021-03-02 14:06:25 UTC
The CircControl syspref description says

> Use the checkout and fines rules of
>   PickupLibrary: the library you are logged in at.
>   PatronLibrary: the library the patron is from.
>   ItemHomeLibrary: the library the item is from.

This is mostly true but there is one exception in the TooMany function where it actually doesn't just change which libraries rules are used but how the the calculation is performed.

With PatronLibrary set the behaviour is as expected by reading the syspref description. However with the setting PickupLibrary the behaviour changes now, instead of just using the rules of the pickup library we also only take into account the loans in the pickup library when calculating whether we are over the checkout limit or not. The same happens with ItemHomeLibrary where we instead calculate the patron's checkouts in the home library of the item being checked out.

We should really try to fix this either by

a) showing that ItemHomeLibrary and PickupLibrary is unacceptable and no one actually wants that, that would allow then making the behaviour similar as what it is to PatronLibrary (so just selecting the right circ rule instead of changing calculation method).

b) Provide a new syspref for changing the calcutation method when PickupLibrary or ItemHomeLibrary CircControl values are used, and set it on upgrade enabled as default.


Ps. svc/letters/preview might use CirControl wrongly as well, I'm not 100% I didn't quite understand but as for other usages of CircControl syspref I grepped where it was used and it correctly only changed the circ rules to be used instead of changing behaviour. So in addition to TooMany we might have to do some changes to svc/letters/preview if it turns out it changes behaviour as well.
Comment 1 Joonas Kylmälä 2021-03-02 14:10:33 UTC
IMHO, easiest way would be to go with option b):

b) Provide a new syspref for changing the calcutation method when PickupLibrary or ItemHomeLibrary CircControl values are used, and set it on upgrade enabled as default.

We might miss some corner case even if we deem option a) safe and so if this new syspref introduced by option b) turns out unused for all users then we can very easily remove it in future and revert it if a corner case comes there. With option a) reverting is not as simple.
Comment 2 Lisette Scheer 2023-06-06 14:49:07 UTC
*** Bug 21045 has been marked as a duplicate of this bug. ***