[Rt-commit] r13227 - in rt/branches/3.8-TESTING: .

sartak at bestpractical.com sartak at bestpractical.com
Thu Jun 12 15:09:17 EDT 2008


Author: sartak
Date: Thu Jun 12 15:09:13 2008
New Revision: 13227

Modified:
   rt/branches/3.8-TESTING/   (props changed)
   rt/branches/3.8-TESTING/share/html/REST/1.0/dhandler

Log:
 r62290 at onn:  sartak | 2008-06-12 15:07:43 -0400
 Canonicalize cf-foo to cf.{foo} early in the REST interface


Modified: rt/branches/3.8-TESTING/share/html/REST/1.0/dhandler
==============================================================================
--- rt/branches/3.8-TESTING/share/html/REST/1.0/dhandler	(original)
+++ rt/branches/3.8-TESTING/share/html/REST/1.0/dhandler	Thu Jun 12 15:09:13 2008
@@ -215,6 +215,16 @@
         unshift @fields, "id";
         $fields{id} = ();
     }
+
+    # canonicalize cf-foo to cf.{foo}
+    for my $field (@fields) {
+        if ($field =~ /^(c(?:ustom)?f(?:ield)?)-(.+)/) {
+            $fields{"cf.{$2}"} = delete $fields{"$1-$2"};
+
+            # overwrite the element in @fields
+            $field = "cf.{$2}";
+        }
+    }
 }
 
 my (@comments, @output);


More information about the Rt-commit mailing list