[Rt-commit] r5137 - in rt/branches/3.5-TESTING: html/REST/1.0/Forms/ticket

kevinr at bestpractical.com kevinr at bestpractical.com
Mon May 1 15:16:41 EDT 2006


Author: kevinr
Date: Mon May  1 15:16:39 2006
New Revision: 5137

Modified:
   rt/branches/3.5-TESTING/   (props changed)
   rt/branches/3.5-TESTING/html/REST/1.0/Forms/ticket/comment

Log:
 r12273 at sad-girl-in-snow:  kevinr | 2006-04-24 19:03:22 -0400
 * Commenting via the REST interface now doesn't error (although it doesn't
 actually /do/ anything, either).


Modified: rt/branches/3.5-TESTING/html/REST/1.0/Forms/ticket/comment
==============================================================================
--- rt/branches/3.5-TESTING/html/REST/1.0/Forms/ticket/comment	(original)
+++ rt/branches/3.5-TESTING/html/REST/1.0/Forms/ticket/comment	Mon May  1 15:16:39 2006
@@ -43,41 +43,30 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-%# REST/1.0/ticket/comment
+%# REST/1.0/Forms/ticket/comment
 %#
 <%ARGS>
 $id
-%changes => {}
-</%ARGS>
-<%INIT>
+%changes
+</%ARGS> 
+<%perl>
 use MIME::Entity;
 use LWP::MediaTypes;
 use RT::Interface::REST;
 use File::Temp qw(tempfile);
 
 $RT::Logger->warning("Got ticket id=$id for comment");
-$RT::Logger->warning("Got args '".keys(%changes)."'.");
+my @temp = grep { !defined $_ } values(%changes);
+$RT::Logger->warning("Got args @temp.");
 
 my $ticket = new RT::Ticket $session{CurrentUser};
 my $status = "200 Ok";
 my $output;
 my $action;
 my $content;
+my ($c, $o, $k, $e) = ("", [], {}, "");
 
 # http://.../REST/1.0/ticket/1/comment
-my ($c, $o, $k, $e) = @{ form_parse($content)->[0] };
-if ($e || !$o) {
-    if (!$o) {
-        $output = "Empty form submitted.\n";
-    }
-    else {
-        $c = "# Syntax error.";
-        $output = form_compose([[$c, $o, $k, $e]]);
-    }
-    $status = "400 Bad Request";
-    goto OUTPUT;
-}
-
 $id =~ s#^/##;
 $id ||= $k->{Ticket};
 unless ($id =~ /^\d+/) {
@@ -173,7 +162,5 @@
 }
 
 OUTPUT:
-</%INIT>
-RT/<% $RT::VERSION %> <% $status %>
-
-<% $output |n %>
+return [ $c, $o, $k, $e ];
+</%perl>


More information about the Rt-commit mailing list