[Bug 29184] New: Warn from chargelostitem when no replacement cost set for item
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29184 Bug ID: 29184 Summary: Warn from chargelostitem when no replacement cost set for item Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org To recreate: 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. -- 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=29184 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=29184 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 125798 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125798&action=edit 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 -- 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=29184 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #2 from Fridolin Somers <fridolin.somers@biblibre.com> --- We see in chargelostitem() : if ($usedefaultreplacementcost && $amount == 0 && $defaultreplacecost){ Shouldn't we patch with : $amount = $amount // 0 Items sql table contains : `replacementprice` decimal(28,6) DEFAULT NULL So indeed default in undef. -- 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=29184 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125798|0 |1 is obsolete| | --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 135076 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135076&action=edit 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 -- 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=29184 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- 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=29184 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |joonas.kylmala@iki.fi --- Comment #4 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Doesn't apply anymore and I think we have a bug: $replacementprice is initialized twice (two my $replacementprice). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29184 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29184 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135076|0 |1 is obsolete| | --- Comment #5 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 140325 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140325&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29184 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29184 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #140325|0 |1 is obsolete| | --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 140335 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140335&action=edit 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 Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29184 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |joonas.kylmala@iki.fi |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29184 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29184 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #140335|0 |1 is obsolete| | --- Comment #7 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- Created attachment 140352 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140352&action=edit 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 Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29184 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29184 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29184 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Resolution|--- |FIXED Status|Pushed to master |RESOLVED --- Comment #9 from Lucas Gass <lucas@bywatersolutions.com> --- Doesn't apply clean to 22.05.x, no backport -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org