[Bug 44164] New: Marking an item lost dies when its item type cannot be resolved
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44164 Bug ID: 44164 Summary: Marking an item lost dies when its item type cannot be resolved Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Fines and fees Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Target Milestone: --- Koha::Account->add_lost_replacement_fee reads the default replacement cost of the item type before it checks useDefaultReplacementCost. Koha::Item->itemtype returns undef when the item has no item type, or when its code is not in the itemtypes table (misc/maintenance/search_for_data_inconsistencies.pl reports such items). The method then dies with: Can't call method "defaultreplacecost" on an undefined value. It dies even when useDefaultReplacementCost is off and a replacement price is given. C4::Circulation::LostItem and Koha::Checkin call it through C4::Accounts::chargelostitem, so marking such an item as lost fails instead of charging the replacement price. Test plan: 1. Set WhenLostChargeReplacementFee to charge, useDefaultReplacementCost to not use 2. Give an item a replacement price of 25 and make its item type empty: UPDATE items SET itype=NULL, replacementprice=25 WHERE barcode='...'; UPDATE biblioitems SET itemtype=NULL WHERE biblionumber=...; 3. Check the item out to a patron and mark it lost from the item page or the patron's checkouts => The operation fails with an error Expected: the patron is charged the replacement price of 25. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44164 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |44165 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44165 [Bug 44165] Use Koha::Item->effective_replacement_price for every default replacement cost fallback -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44164 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org