Bugzilla – Attachment 152936 Details for
Bug 33028
Wrongly formatted monetary amounts in circulation rules break scripts and calculations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33028: Throw exception if not passed a decimal number
Bug-33028-Throw-exception-if-not-passed-a-decimal-.patch (text/plain), 1.15 KB, created by
Martin Renvoize (ashimema)
on 2023-07-03 12:47:40 UTC
(
hide
)
Description:
Bug 33028: Throw exception if not passed a decimal number
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-07-03 12:47:40 UTC
Size:
1.15 KB
patch
obsolete
>From 6296aaf58c082d24ee55cb76d9b309168f1af033 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 3 Jul 2023 13:45:28 +0100 >Subject: [PATCH] Bug 33028: Throw exception if not passed a decimal number > >--- > Koha/CirculationRules.pm | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm >index b06f8fd12c..38cd6a26b0 100644 >--- a/Koha/CirculationRules.pm >+++ b/Koha/CirculationRules.pm >@@ -381,7 +381,8 @@ sub set_rule { > my $can_be_blank = defined $kind_info->{can_be_blank} ? $kind_info->{can_be_blank} : 1; > $rule_value = undef if defined $rule_value && $rule_value eq "" && !$can_be_blank; > my $is_monetary = defined $kind_info->{is_monetary} ? $kind_info->{is_monetary} : 0; >- $rule_value = Koha::Number::Price->new($rule_value)->unformat if defined $rule_value && $is_monetary; >+ Koha::Exceptions::BadParameter->throw("set_rule expected decimal") >+ if ( $is_monetary && defined($rule_value) && $rule_value !~ /^\d+(\.\d{2})?$/ ); > > for my $v ( $branchcode, $categorycode, $itemtype ) { > $v = undef if $v and $v eq '*'; >-- >2.41.0
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 33028
:
147058
|
147686
|
147687
|
147688
|
152441
|
152442
|
152443
|
152444
|
152445
|
152446
|
152509
|
152510
|
152511
|
152512
|
152513
|
152514
|
152515
|
152752
|
152753
|
152754
|
152755
|
152756
|
152757
|
152758
|
152759
|
152760
|
152761
|
152762
|
152763
|
152764
|
152803
|
152804
|
152805
|
152829
|
152928
|
152929
|
152930
|
152931
|
152932
|
152933
|
152934
|
152935
|
152936
|
153313
|
153314
|
153315
|
153316
|
153317
|
153318
|
153319
|
153320
|
153321
|
153322
|
153323
|
153619
|
153620
|
153632
|
153633
|
153634
|
153635
|
153636
|
153677