[Rt-devel] PATCH: submission of '0' via REST interface

David Schweikert dws at ee.ethz.ch
Fri Apr 21 10:02:55 EDT 2006


Hi,

The following patch fixes a problem in the REST interface: currently it
is not possible to submit '0' as a value (because of it being "false" in
Perl). It means that it is for example not possible to set a priority to
0 via the rt command-line.


--- RT/Interface/REST.pm	2006-04-21 15:46:18.693515000 +0200
+++ RT/Interface/REST.pm	2006-04-21 15:58:24.703729000 +0200
@@ -110,8 +110,8 @@
             }
             elsif ($state <= 1 && $line =~ /^($field):(?:\s+(.*))?$/) {
                 # Read a field: value specification.
-                my $f  = $1;
-                my @v  = ($2 || ());
+                my ($f, $vtmp) = ($1, $2);
+                my @v = ($vtmp =~ /\S/ ? ($vtmp) : ());
 
                 # Read continuation lines, if any.
                 while (@lines && ($lines[0] eq '' || $lines[0] =~ /^\s+/)) {


Cheers
David
-- 
David Schweikert        | phone: +41 44 632 7019
System manager ISG.EE   | walk:  ETH Zentrum, ETL F24.1
ETH Zurich, Switzerland | web:   http://people.ee.ethz.ch/dws


More information about the Rt-devel mailing list