Bug 41405 - Patron categories noissuescharge values default to 0 when not set
Summary: Patron categories noissuescharge values default to 0 when not set
Status: In Discussion
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-08 18:44 UTC by Nick Clemens (kidclamp)
Modified: 2025-12-08 19:34 UTC (History)
5 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 41405: Treat blank value as unset (6.80 KB, patch)
2025-12-08 18:57 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2025-12-08 18:44:23 UTC
To recreate:
1 - In a new KTD, check the values for a category:
    SELECT * FROM categories WHERE categorycode ='B'\G
2 - By default these three columns are null:
                        noissuescharge: NULL
              noissueschargeguarantees: NULL
noissueschargeguarantorswithguarantees: NULL
3 - If they are not, set them so:
    UPDATE categories SET noissuescharge=NULL, noissueschargeguarantees=NULL, noissueschargeguarantorswithguarantees=NULL;
4 - Open the category in staff interface:
    More->Administration->Patron categories->Edit
5 - Note the three inputs are set to 0
    Checkout charge limit
    Guarantees checkout charge limit
    Guarantors with guarantees checkout charge limit
6 - Save the entry without making changes
7 - Check the DB as in Step 1
8 - Note all values are 0
9 - Edit and black the inputs and save
10 - Check the DB
11 - Note all value are now undef

We should not have to edit the form to prevent changes
Comment 1 Nick Clemens (kidclamp) 2025-12-08 18:57:51 UTC
Created attachment 190308 [details] [review]
Bug 41405: Treat blank value as unset
Comment 2 Nick Clemens (kidclamp) 2025-12-08 19:34:18 UTC
Maybe this is actually invalid?

The code that checks these in Koha::Patron::is_patron_inside_charge_limit uses:

3512     my $no_issues_charge = $patron_category->noissuescharge || C4::Context->preference('noissuescharge');
3513     my $no_issues_charge_guarantees =
3514         $patron_category->noissueschargeguarantees || C4::Context->preference('NoIssuesChargeGuarantees');
3515     my $no_issues_charge_guarantors_with_guarantees = $patron_category->noissueschargeguarantorswithguarantees
3516         || C4::Context->preference('NoIssuesChargeGuarantorsWithGuarantees');
3517 

So if they are 0 they don't matter?

I don't think it is supposed to work this way though - based on 41404 and the way NoIssuesCharge seems to work a 'blank' is "There is no limit" and Zero should be "Any fines should block issues"