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

            Bug ID: 42565
           Summary: GetIssuingCharges returns undef when rentalcharge is
                    NULL
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P5 - low
         Component: Circulation
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected], [email protected]

GetIssuingCharges initializes $charge = 0 but then overwrites it with the raw
value from itemtypes.rentalcharge. When no rental charge is configured (NULL in
the database, which is the default), the function returns undef instead of 0.

This causes 'Use of uninitialized value' warnings in every caller that does
$charge > 0, notably during automatic renewals (cron), SIP checkout/renew, and
the OPAC user page.

The fix is trivial: normalize NULL to 0 at the assignment point in
GetIssuingCharges. All callers already treat the return as numeric and only act
on positive values, so this is safe.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to