summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authormark <mark>2011-03-24 23:24:55 +0000
committermark <mark>2011-03-24 23:24:55 +0000
commitb286341305ba302c4a555aeef288f84c7141ccdd (patch)
tree2327fe8272e59533ca495125b3b8a5744a215b5c /FS
parente32e1a2357e42a596d12d814f06b8902d05240a1 (diff)
fix data type issue, #11834
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/part_event/Condition.pm12
-rw-r--r--FS/FS/part_event/Condition/times.pm2
2 files changed, 13 insertions, 1 deletions
diff --git a/FS/FS/part_event/Condition.pm b/FS/FS/part_event/Condition.pm
index 90b83853e..9155a7d42 100644
--- a/FS/FS/part_event/Condition.pm
+++ b/FS/FS/part_event/Condition.pm
@@ -457,6 +457,18 @@ sub age2seconds_sql {
}
+=item condition_sql_option_integer
+
+As I<condition_sql_option>, but cast the option value to an integer so that
+comparison to other integers is type-correct.
+
+=cut
+
+sub condition_sql_option_integer {
+ my ($class, $option) = @_;
+ 'CAST ('.$class->condition_sql_option($option).' AS INTEGER)';
+}
+
=head1 NEW CONDITION CLASSES
A module should be added in FS/FS/part_event/Condition/ which implements the
diff --git a/FS/FS/part_event/Condition/times.pm b/FS/FS/part_event/Condition/times.pm
index 428a2cb09..91212e778 100644
--- a/FS/FS/part_event/Condition/times.pm
+++ b/FS/FS/part_event/Condition/times.pm
@@ -49,7 +49,7 @@ sub condition_sql {
AND status != 'failed'
)";
- "$existing <= ". $class->condition_sql_option('run_times');
+ "$existing <= ". $class->condition_sql_option_integer('run_times');
}