Bugzilla – Attachment 125798 Details for
Bug 29184
Warn from chargelostitem when no replacement cost set for item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29184: Fix warn about undefined replacecost
Bug-29184-Fix-warn-about-undefined-replacecost.patch (text/plain), 1.31 KB, created by
Nick Clemens (kidclamp)
on 2021-10-06 12:50:00 UTC
(
hide
)
Description:
Bug 29184: Fix warn about undefined replacecost
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-10-06 12:50:00 UTC
Size:
1.31 KB
patch
obsolete
>From ce79e0ce09dd5e7658330db2f31d34b4f0570339 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 6 Oct 2021 12:48:23 +0000 >Subject: [PATCH] Bug 29184: Fix warn about undefined replacecost > >This patch simply sets the cost to 0 if undefined > >To test: >1 - Create a new item with no replacement cost set >2 - Check the item out to a patron >3 - Mark the item lost >4 - Note in plack-intranet-error.log: > [2021/10/06 12:43:26] [WARN] Use of uninitialized value $replacementprice in numeric gt (>) at /kohadevbox/koha/C4/Accounts.pm line 114. >5 - Apply patch >6 - Repeat >7 - No warn >--- > C4/Accounts.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index ad0d34f184..a79af6ad12 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -71,7 +71,7 @@ sub chargelostitem { > my $dbh = C4::Context->dbh(); > my ($borrowernumber, $itemnumber, $amount, $description) = @_; > my $itype = Koha::ItemTypes->find({ itemtype => Koha::Items->find($itemnumber)->effective_itemtype() }); >- my $replacementprice = $amount; >+ my $replacementprice = $amount // 0; > my $defaultreplacecost = $itype->defaultreplacecost; > my $processfee = $itype->processfee; > my $usedefaultreplacementcost = C4::Context->preference("useDefaultReplacementCost"); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29184
:
125798
|
135076
|
140325
|
140335
|
140352